Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Partial Port of Adafruit CircuitPython to Micropython of PN532 NFC/RFID control library (SPI)

License

NotificationsYou must be signed in to change notification settings

Carglglz/NFC_PN532_SPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

MicroPython SPI driver for thePN532 NFC/RFID Breakout andPN532 NFC/RFID Shield (port fromCircuitPython driver )

Example:

import NFC_PN532 as nfcfrom machine import Pin, SPI# SPIspi_dev = SPI(1, baudrate=1000000)cs = Pin(5, Pin.OUT)cs.on()# SENSOR INITpn532 = nfc.PN532(spi_dev,cs)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 cardspn532.SAM_configuration()# FUNCTION TO READ def read_nfc(dev, tmot):    """Accepts a device and a timeout in millisecs """    print('Reading...')    uid = dev.read_passive_target(timeout=tmot)    if uid is None:        print('CARD NOT FOUND')    else:        numbers = [i for i in uid]        string_ID = '{}-{}-{}-{}'.format(*numbers)        print('Found card with UID:', [hex(i) for i in uid])        print('Number_id: {}'.format(string_ID))read_nfc(pn532, 500)Reading...Found card with UID: ['0x0', '0xa', '0x33', '0xc0']Number_id: 0-10-51-192

Datasheet:

PN532

User Manual:

PN532 User Manual

About

Partial Port of Adafruit CircuitPython to Micropython of PN532 NFC/RFID control library (SPI)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp