{"id":13801970,"url":"https://github.com/Carglglz/NFC_PN532_SPI","last_synced_at":"2025-05-13T12:32:12.319Z","repository":{"id":45402488,"uuid":"215338638","full_name":"Carglglz/NFC_PN532_SPI","owner":"Carglglz","description":"Partial Port of Adafruit CircuitPython to Micropython of PN532 NFC/RFID control library (SPI)","archived":false,"fork":false,"pushed_at":"2023-07-17T13:33:25.000Z","size":38,"stargazers_count":41,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-10T14:12:26.210Z","etag":null,"topics":["micropython","nfc","pn532"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Carglglz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-10-15T15:54:54.000Z","updated_at":"2024-09-23T13:22:02.000Z","dependencies_parsed_at":"2024-01-29T19:40:33.897Z","dependency_job_id":null,"html_url":"https://github.com/Carglglz/NFC_PN532_SPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2FNFC_PN532_SPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2FNFC_PN532_SPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2FNFC_PN532_SPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2FNFC_PN532_SPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Carglglz","download_url":"https://codeload.github.com/Carglglz/NFC_PN532_SPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225217913,"owners_count":17439712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["micropython","nfc","pn532"],"created_at":"2024-08-04T00:01:31.920Z","updated_at":"2024-11-18T17:30:37.628Z","avatar_url":"https://github.com/Carglglz.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Communications"],"readme":"## MicroPython - PN532 NFC/RFID DRIVER (SPI)\n\nMicroPython SPI driver for the [PN532 NFC/RFID Breakout](https://www.adafruit.com/product/364) and [PN532 NFC/RFID Shield](https://www.adafruit.com/product/789) (port from [CircuitPython driver](https://github.com/adafruit/Adafruit_CircuitPython_PN532) )\n\n\n\n### Example:\n\n```\nimport NFC_PN532 as nfc\nfrom machine import Pin, SPI\n\n# SPI\nspi_dev = SPI(1, baudrate=1000000)\ncs = Pin(5, Pin.OUT)\ncs.on()\n\n# SENSOR INIT\npn532 = nfc.PN532(spi_dev,cs)\nic, ver, rev, support = pn532.get_firmware_version()\nprint('Found PN532 with firmware version: {0}.{1}'.format(ver, rev))\n\n# Configure PN532 to communicate with MiFare cards\npn532.SAM_configuration()\n\n# FUNCTION TO READ \ndef read_nfc(dev, tmot):\n    \"\"\"Accepts a device and a timeout in millisecs \"\"\"\n    print('Reading...')\n    uid = dev.read_passive_target(timeout=tmot)\n    if uid is None:\n        print('CARD NOT FOUND')\n    else:\n        numbers = [i for i in uid]\n        string_ID = '{}-{}-{}-{}'.format(*numbers)\n        print('Found card with UID:', [hex(i) for i in uid])\n        print('Number_id: {}'.format(string_ID))\n\n\nread_nfc(pn532, 500)\nReading...\nFound card with UID: ['0x0', '0xa', '0x33', '0xc0']\nNumber_id: 0-10-51-192\n```\n\n\n\n### Datasheet:\n\n**[PN532](https://www.nxp.com/docs/en/nxp/data-sheets/PN532_C1.pdf)**\n\n### User Manual:\n\n**[PN532 User Manual](https://www.nxp.com/docs/en/user-guide/141520.pdf)** ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCarglglz%2FNFC_PN532_SPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCarglglz%2FNFC_PN532_SPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCarglglz%2FNFC_PN532_SPI/lists"}