I've been working to build an RFID lock so I started with a sketch I found online. I tweaked it a little to customize it. The sketch allows for multiple RFID tag UID's to be stored in EEPROM. My problem is that the sketch only unlocks the door for the first saved UID. If anyone can please look through it and find why it does this I would greatly appreciate it.
Im using an arduino uno with a mfrc522 rf reader.
The sketch allows for multiple RFID tag UID's to be stored in EEPROM
But, in setup(), you only read the master RFID tag, if stored, or you wait for the master RFID tag to be scanned, then you store it and read it.
if ( checkTwo( find, storedCard ) ) // Check to see if the storedCard read from EEPROM matches
{
return true;
break; // Stop looking we found it
}
else
{
return false;
}
What is the point of the break statement?
In findID(), the number of stored tags is loaded into count. In writeID(), the number of stored tags is loaded into num. Consistency is a good thing.
Add Serial.print() statements to writeID() and findID(). Do they agree on how many cards are stored?