openauto_raspberry/readingData/rfid.py
2017-10-29 18:59:46 +01:00

8 lines
168 B
Python

import serial
port = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=0.2)
while True:
rcv = port.readline()
if len(rcv) > 10:
print "tag detected: " + rcv