Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import serial
- ###################
- # PRIVATE CLASSES #
- ###################
- # wait acknowledgment for data reception
- def wait_ack(self):
- s = self.serialVM.read(1)
- if len(s) > 0:
- s = int.from_bytes(s, byteorder='little', signed=False)
- self.status = 1
- return(s)
- return -1
- def check_selection(self):
- self.serialVM.flushInput()
- self.serialVM.write(bytearray.fromhex("32"))
- req = self.wait_ack() #THIS SHOULD RETURN THE DECIMAL VALUE BUT RETURNS WRONG DECIMALS
- if (req != 254) and (req != 0):
- return req
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment