Interactive Device Design / Mbed 2 deprecated readMifare

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

main.cpp File Reference

main.cpp File Reference

Go to the source code of this file.


Detailed Description

Author:
Adafruit Industries Ben Zhang <benzh@eecs.berkeley.edu> BSD (see license.txt)

This example will wait for any ISO14443A card or tag, and depending on the size of the UID will attempt to read from it.

If the card has a 4-byte UID it is probably a Mifare Classic card, and the following steps are taken:

  • Authenticate block 4 (the first block of Sector 1) using the default KEYA of 0XFF 0XFF 0XFF 0XFF 0XFF 0XFF
  • If authentication succeeds, we can then read any of the 4 blocks in that sector (though only block 4 is read here)

If the card has a 7-byte UID it is probably a Mifare Ultralight card, and the 4 byte pages can be read directly. Page 4 is read by default since this is the first 'general- purpose' page on the tags.

This is an example sketch for the Adafruit PN532 NFC/RFID breakout boards This library works with the Adafruit NFC breakout ----> https://www.adafruit.com/products/364

Check out the links above for our tutorials and wiring diagrams These chips use SPI to communicate, 4 required to interface

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Definition in file main.cpp.