Skip to content

Instantly share code, notes, and snippets.

@pgrandin
Created June 9, 2016 20:49
Show Gist options
  • Save pgrandin/3b35e2fa661baa7cfaa5f3d3b31977ce to your computer and use it in GitHub Desktop.
Save pgrandin/3b35e2fa661baa7cfaa5f3d3b31977ce to your computer and use it in GitHub Desktop.
import serial
serial = serial.Serial("/dev/ttyAMA0",
baudrate=9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=0.8)
while True:
rfid = serial.readline().strip()
if len(rfid) > 5:
print rfid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment