diff --git a/python/EDS.py b/python/EDS.py index 3ae662b..64e48f7 100644 --- a/python/EDS.py +++ b/python/EDS.py @@ -46,12 +46,10 @@ class LED: """ if t == 0: self.i2.start(self.a, 0) - self.i2.write(bytes((0, r, g, b))) - self.i2.stop() + self.i2.regwr(self.a, 0, r, g, b) else: self.i2.start(self.a, 0) - self.i2.write(bytes((1, r, g, b, t))) - self.i2.stop() + self.i2.regwr(self.a, 1, r, g, b, t) def hex(self, hhh, t = 0): """ diff --git a/python/i2cdriver.py b/python/i2cdriver.py index e828ca7..04b46d5 100644 --- a/python/i2cdriver.py +++ b/python/i2cdriver.py @@ -76,12 +76,12 @@ class I2CDriver: if PYTHON2: def __ser_w(self, s): - if isinstance(s, list): + if isinstance(s, list) or isinstance(s, tuple): s = "".join([chr(c) for c in s]) self.ser.write(s) else: def __ser_w(self, s): - if isinstance(s, list): + if isinstance(s, list) or isinstance(s, tuple): s = bytes(s) self.ser.write(s)