Download and install the Rick_Temp branch of the library, here:
https://github.com/adafruit/Adafruit-PN ... /rick_temp
Then run this sketch with it to see the interrupt count increment in Serial Monitor
Code: Select all
#include <Adafruit_PN532.h>
#define SCK (13)
#define MOSI (11)
#define SS (10)
#define MISO (12)
Adafruit_PN532 nfc(SCK, MISO, MOSI, SS);
void setup(void) {
Serial.begin(115200);
Serial.println("Hello!");
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
if (! versiondata) {
Serial.print("Didn't find PN53x board");
while (1); // halt
}
// Got ok data, print it out!
Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX);
Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC);
Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
// configure board to read RFID tags
nfc.SAMConfig();
Serial.println("Waiting for an ISO14443A Card ...");
attachInterrupt(0, IRQ_ISR, FALLING);
}
int intcount = 0;
int previntcount = 0;
bool firsttime = true;
void IRQ_ISR()
{
intcount++;
}
void loop(void) {
uint8_t success;
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID
uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
if (intcount != previntcount)
{
Serial.println(intcount);
previntcount = intcount;
}
nfc.enableRead(PN532_MIFARE_ISO14443A, uid, &uidLength);
}