I am interfacing a RFID sensor (MFRC522) with a Raspberry Pi. I am currently testing the whole system out. Basically, once the RFID tag is swiped it outputs a number associated with it. I want the python code to read in the RFID number and compare it with the variable 'a.' When I attempt to do this, though, I am getting an invalid syntax error for the 'if' statement and I am not sure why. I am new to Python.
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
GPIO.setwarings(False)
a = 699562167785
reader = SimpleMFRC522()
try:
id = reader.read()
print (id)
if id == a
print ("Awesome")
finally:
GPIO.cleanup()
Aucun commentaire:
Enregistrer un commentaire