#include #include #define PN532_CS 10 PN532 nfc(PN532_CS); const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup(void) { nfc.begin(); uint32_t versiondata = nfc.getFirmwareVersion(); if (! versiondata) { while (1); // halt } // configure board to read RFID tags and cards nfc.SAMConfig(); } void loop(void) { uint32_t id; // look for MiFare type cards id = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A); if (id != 0) { uint8_t keys[]= { 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF }; if(nfc.authenticateBlock(1, id ,0x08,KEY_A,keys)) //authenticate block 0x08 { //if authentication successful uint8_t block[16]; //read memory block 0x08 if(nfc.readMemoryBlock(1,0x08,block)) { } } } delay(1000); }