Skip to content

Commit

Permalink
Fix read with MFRC522
Browse files Browse the repository at this point in the history
Zeros in UID had a bug in HEX conversion
  • Loading branch information
matjack1 committed Mar 28, 2023
1 parent 5543625 commit abd0e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rfid.esp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void mfrc522Read()
#endif
for (int i = 0; i < mfrc522.uid.size; ++i)
{
uid += String(mfrc522.uid.uidByte[i], HEX);
uid += String(mfrc522.uid.uidByte[mfrc522.uid.size - (i + 1)] < 0x10 ? "0" : "");
rfidState = cardSwiped;
}
#ifdef DEBUG
Expand Down

0 comments on commit abd0e66

Please sign in to comment.