我刚购买了RFID阅读器,但MFRC522 python模块遇到了问题。例如,当我运行Read.py文件时,它显示该错误:
Traceback (most recent call last):
File "..."
import SimpleMFRC522
File "..."
import MFRC522
File "..."
import spi
Read.py代码为:
#!/usr/bin/env python
import RPi.GPIO as GPIO
import SimpleMFRC522
reader = SimpleMFRC522.SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()