Im using the NFC shield on an "extensive" code for a big project.
What i call lockout, is the act of keeping the tag next to the NFC shield, removing the delay, and not keep reading the tag over and over.
I have this in my loop cycle
Code: Select all
void SistemaEndradaRFID(struct TecladosMatriz& teclados)
{
boolean success;
uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
uint8_t uidLength;
success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
if (success) {
Serial.println("Found a card!");
Serial.print("UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
Serial.print("UID Value: ");
for (uint8_t i=0; i < uidLength; i++)
{
Serial.print(uid[i], DEC);
}
Serial.println("");
// Wait 1 second before continuing
delay(1000);
}
else
{
// PN532 probably timed out waiting for a card
Serial.println("Timed out waiting for a card");
}
}
I've used a similar code to this, if you are familiar with the analog keypad, but its not working.
How can I make the lockout?
Greetings