Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created November 22, 2019 19:47
Show Gist options
  • Save wesleyit/adce5cc23e1734f66719b2a9fd1bb2ce to your computer and use it in GitHub Desktop.
Save wesleyit/adce5cc23e1734f66719b2a9fd1bb2ce to your computer and use it in GitHub Desktop.
Read tags from RDM6300 on UART @ Linux
import time
import serial
s = serial.Serial('/dev/ttyUSB0', 9600)
latest_tag = 0
while True:
tag_bytes = s.read(14)
print(tag_bytes)
tag = int(tag_bytes.decode()[4:11], base=16)
if latest_tag != tag:
print(tag)
latest_tag = tag
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment