forked from platypush/platypush
Made the ZeroBorg module Python3-friendly
This commit is contained in:
parent
f16719f575
commit
779a907ebd
1 changed files with 3 additions and 4 deletions
|
@ -217,9 +217,8 @@ Command codes can be found at the top of ZeroBorg.py, data is a list of 0 or mor
|
||||||
|
|
||||||
Under most circumstances you should use the appropriate function instead of RawWrite
|
Under most circumstances you should use the appropriate function instead of RawWrite
|
||||||
"""
|
"""
|
||||||
rawOutput = chr(command)
|
rawOutput = bytes([command])
|
||||||
for singleByte in data:
|
if data: rawOutput += bytes(data)
|
||||||
rawOutput += chr(singleByte)
|
|
||||||
self.i2cWrite.write(rawOutput)
|
self.i2cWrite.write(rawOutput)
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,7 +239,7 @@ Under most circumstances you should use the appropriate function instead of RawR
|
||||||
rawReply = self.i2cRead.read(length)
|
rawReply = self.i2cRead.read(length)
|
||||||
reply = []
|
reply = []
|
||||||
for singleByte in rawReply:
|
for singleByte in rawReply:
|
||||||
reply.append(ord(singleByte))
|
reply.append(singleByte)
|
||||||
if command == reply[0]:
|
if command == reply[0]:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue