diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2014-06-11 12:46:16 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2014-06-11 12:46:16 +0300 |
| commit | c16f5ae46480e5d9302722397c79b07f7feddb67 (patch) | |
| tree | ec88882828c564931e029772951a204a93cd6e87 /client.py | |
| parent | 25a683b9d5e6cb37460f37bb5ad8257ed7ce584a (diff) | |
Diffstat (limited to 'client.py')
| -rw-r--r-- | client.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,3 +1,5 @@ +import serial + from itertools import cycle from pprint import pprint from time import sleep @@ -19,7 +21,7 @@ class LightLoopClient(object): return '{}\n{}\n{}'.format(self.sequences, self.composition, self.tempo) def init_serial(self): - self.serial = open(DATA_DIR.child('serial.out'), 'a') + self.serial = serial.Serial('/dev/ttyUSB0', 115200) def init_data(self): with open(DATA_DIR.child('data.txt'), 'r') as f: @@ -66,7 +68,6 @@ class LightLoopClient(object): def write(self, packets): self.serial.write(packets) - self.serial.flush() def loop(self): for frame in cycle(self.data_packets): |
