openauto_raspberry/readingData/rfid.py

9 lines
168 B
Python
Raw Permalink Normal View History

2017-10-29 17:59:46 +00:00
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