regwr accepts tuples properly. Fix EDS.LED for Python 2
This commit is contained in:
parent
895f5a3941
commit
652fdd41d4
|
@ -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):
|
||||
"""
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue