This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tutorials:products:rfidnfc:arduino.html [2011/09/02 17:05] ladyada created |
tutorials:products:rfidnfc:arduino.html [2016/01/28 18:05] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Moved! ====== | ||
- | + | This tutorial has moved to [[http://learn.adafruit.com/adafruit-pn532-rfid-nfc|http://learn.adafruit.com/adafruit-pn532-rfid-nfc]] | |
- | ==== Library ==== | + | |
- | + | ||
- | + | ||
- | We have a basic library for talking to the PN532 via a microcontroller. Right now all it does is read the 4 digit ID burned into each chip but it will eventually be expanded to read and write from the tag EEPROM | + | |
- | + | ||
- | + | ||
- | + | ||
- | [[#Download|Download the PN532 library from github (see below). ]] Uncompress the folder and rename the folder **PN532**. Inside the folder you should see the **PN532.cpp** and **PN532.h** files. Install the **PN532** library foler by placing it in your **//arduinosketchfolder///libraries** folder. You may have to create the **libraries** subfolder if this is your first library. [[http://www.ladyada.net/library/arduino/libraries.html|You can read more about installing libraries in our tutorial]] | + | |
- | + | ||
- | + | ||
- | + | ||
- | Restart the Arduino IDE. You should now be able to select **File > Examples > PN532 > readMifare** sketch. Upload the sketch to your Arduino wired as above. | + | |
- | + | ||
- | + | ||
- | + | ||
- | In the serial monitor, you should see that it found the **PN532** chip. Then you can place your tag nearby and it will display the 4 byte ID code (this one is 0xAE 0x4C 0xF0 0x6C) and then the integer version of all four bytes together. You can use this number to identify each card. Recently NXP made so many cards that they actually ran through all 4 Bytes (2^32) so the number is not guaranteed to be absolutely unique. However, the chances are extremely slim you will have two cards with the same ID so as long as you aren't using these cards for anything terribly important (like money transfer) its fine to use the number as a unique identifier | + | |
- | + | ||
- | {{ http://www.ladyada.net/images/rfidnfc/pn532test.gif?nolink&500x248 |}} | + |