diff --git a/README.md b/README.md index ba06a29..305eb2f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,6 @@ alphasign is a Python library for [Betabrite](http://www.betabrite.com/). It implements the [Alpha Communications Protocol](http://www.alpha-american.com/p-alpha-communications-protocol.html). -[Read the Docs](http://readthedocs.org/docs/alphasign) +[Read the Docs](https://alphasign.readthedocs.io/en/latest/) ![Betabrite Prisom displaying the time and temperature updated by a program using the alphasign library.](http://farm9.staticflickr.com/8010/7151560649_2d5f04955b.jpg) diff --git a/alphasign/__init__.py b/alphasign/__init__.py index 17778c6..dd3237c 100644 --- a/alphasign/__init__.py +++ b/alphasign/__init__.py @@ -7,6 +7,7 @@ def main(): sign = alphasign.USB(alphasign.devices.USB_BETABRITE_PRISM) + # sign = alphasign.interfaces.local.Serial(device='/dev/ttyUSB0', baudrate=38400) # serial version sign.connect() sign.clear_memory() diff --git a/alphasign/interfaces/local.py b/alphasign/interfaces/local.py index 8eb1800..e70aebe 100644 --- a/alphasign/interfaces/local.py +++ b/alphasign/interfaces/local.py @@ -10,12 +10,15 @@ class Serial(base.BaseInterface): This class uses `pySerial `_. """ - def __init__(self, device="/dev/ttyS0"): + def __init__(self, device="/dev/ttyS0", baudrate=4800): """ :param device: character device (default: /dev/ttyS0) :type device: string + :param baudrate: baudrate (default: 4800) + :type baudrate: integer """ self.device = device + self.baudrate = baudrate self.debug = True self._conn = None @@ -25,7 +28,7 @@ def connect(self): # TODO(ms): these settings can probably be tweaked and still support most of # the devices. self._conn = serial.Serial(port=self.device, - baudrate=4800, + baudrate=self.baudrate, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_TWO, bytesize=serial.SEVENBITS,