From c16f5ae46480e5d9302722397c79b07f7feddb67 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 11 Jun 2014 12:46:16 +0300 Subject: Add missing serial call --- client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client.py') diff --git a/client.py b/client.py index 4665e82..991b2d3 100644 --- a/client.py +++ b/client.py @@ -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): -- cgit v1.3.1