1
0
Fork 0

test as byte literals

This commit is contained in:
Kevin Matz 2019-07-30 09:34:00 -04:00
parent 02b93940f4
commit 68b9e26064
1 changed files with 2 additions and 2 deletions

View File

@ -56,10 +56,10 @@ class Robot:
def serial_read_handler(self, data):
data = data.strip()
if data.startswith(b'{') and data.endswith(b'}'):
data = data.lstrip('{').rstrip('}')
data = data.lstrip(b'{').rstrip(b'}')
else:
return # malformed packet
data = data.split(',')
data = data.split(b',')
try:
self.angle = [int(hex, 16) for hex in data]
except ValueError: