【发布时间】:2021-01-20 10:57:04
【问题描述】:
我正在使用 RFID 阅读器 MFRC522 NFC 阅读器套件,并希望读取并打印底部下方所示的标签记录编号。我要打印的是记录 0 部分。我无法理解它只读取记录在相关卡上的这个标签以外的一些数字。
我的代码如下:
from PyQt5.QtCore import QThread, pyqtSignal
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import time
reader = SimpleMFRC522()
class RFIDThread(QThread):
change_text_signal = pyqtSignal(list)
def __init__(self):
super().__init__()
self._run_flag = True
def run(self):
try:
while (True):
id, text = reader.read()
self.change_text_signal.emit([id, text])
time.sleep(2)
finally:
GPIO.cleanup()
def stop(self):
"""Sets run flag to False and waits for thread to finish"""
self._run_flag = False
self.wait()
我需要知道如何读取我需要的值。有谁知道我该怎么做?
【问题讨论】:
标签: python raspberry-pi nfc rfid