Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion rfid/rfid.ino
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,18 @@ boolean getID()
for ( uint8_t i = 0; i < 4; i++) {
//readCard[i] = mfrc522.uid.uidByte[i];
// Adds the 4 bytes in a single String variable
tagID.concat(String(mfrc522.uid.uidByte[i], HEX));
uint8_t value = mfrc522.uid.uidByte[i];
// Checks to see if the value is smaller
// than 16 (0x10) and adds the 0 padding needed if needed
if (value<0x10) {
tagID.concat("0");
}
tagID.concat(String(value, HEX));
}
//MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
tagID.toUpperCase();
mfrc522.PICC_HaltA(); // Stop reading
return true;
//MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
}