Quantcast
Channel: fischertechnik community forum
Viewing all articles
Browse latest Browse all 1329

Robo Pro / Computing / Software • Re: NFC-Reader Beispielsoftware

$
0
0
RoboPro coding => TXT4.0

Python
Probably you need:
to develop a driver in Python for the PN532
from adafruit_pn532.i2c import PN532_I2C
import nfc
import ndef

A suggestion for an experiment with PN532:
Be aware of the I2C clock stretching issues of the pn532, see the data sheet and adafruit
If the I2C bus supports clock stretching, you don't'need req=req_pin, irq=irq_pin,

CODE:

 pn532 = PN532_I2C(i2c, debug=False, req=req_pin,  irq=irq_pin, reset=reset_pin)    ic, ver, rev, support = pn532.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...")    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 is None:            # print("No card found")            continue        print("Found card with UID 01:", [hex(i) for i in uid])        pn532.mifare_classic_read_block()        pn532.mifare_classic_authenticate_block()        pn532.ntag2xx_read_block()        pn532.mifare_classic_get_value_block()        print("found")
I was using a FT232H USB to I2C with GPIO ports for experimenting with the PN532.
https://www.adafruit.com/product/2264

Statistik: Verfasst von vleeuwen — 04 Apr 2024, 22:25



Viewing all articles
Browse latest Browse all 1329