Skip to content

Commit

Permalink
Merge pull request #613 from plex3r/dev
Browse files Browse the repository at this point in the history
RFID uid fix
  • Loading branch information
matjack1 authored Jan 16, 2024
2 parents 2215b18 + 81cbd9c commit 95beda0
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 95beda0

Please sign in to comment.