资源简介
(read-addr-from-card.py)
代码片段和文件信息
import RPi.GPIO as GPIO
import pn532.pn532 as nfc
from pn532 import *
pn532 = PN532_UART(debug=False reset=20)
ic ver rev support = pn532.get_firmware_version()
print(‘Found PN532 with firmware version: {0}.{1}‘.format(ver rev))
# Configure PN532 to communicate with MiFare cards
pn532.SAM_configuration()
print(‘Waiting for RFID/NFC card to write to!‘)
while True:
# Check if a card is available to read
uid = pn532.read_passive_target(timeout=0.5)
print(‘.‘ end=““)
# Try again if no card is available.
if uid
评论
共有 条评论