Skip to content

Commit

Permalink
Update rfid.esp
Browse files Browse the repository at this point in the history
Better version built on existing idea
  • Loading branch information
plex3r committed Dec 19, 2023
1 parent 973cdc3 commit 20e4dcb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/rfid.esp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ void mfrc522Read()
#ifdef DEBUG
Serial.print(F("[ INFO ] PICC's UID: "));
#endif
for (int i = 0; i < mfrc522.uid.size; ++i)
{
uid += String(mfrc522.uid.uidByte[mfrc522.uid.size - (i + 1)] < 0x10 ? "0" : "");
rfidState = cardSwiped;
}
for (byte i = 0; i < mfrc522.uid.size; i++)
{
uid+=(String(mfrc522.uid.uidByte[i] < 0x10 ? "0" : ""));
uid+=(String(mfrc522.uid.uidByte[i], HEX));
}
rfidState = cardSwiped;

#ifdef DEBUG
Serial.print(uid);
#endif
Expand Down

0 comments on commit 20e4dcb

Please sign in to comment.