]> Pileus Git - ~andy/csm213a-hw/blob - vis/device.py
a2050335fad4bc61ee56ec614a1e91a5b79e6272
[~andy/csm213a-hw] / vis / device.py
1 from serial import Serial
2
3 class Device:
4         # Attributes
5         port = "/dev/ttyACM0"
6
7         # Constructors
8         def __init__(self, config):
9                 self.config = config
10
11         # Methods
12         def connect(self):
13                 self.conn = Serial(self.port, \
14                         baudrate = self.config.baudrate, \
15                         parity   = self.config.parity,   \
16                         bytesize = self.config.databits, \
17                         stopbits = self.config.stopbits)
18