I am working on making an Arduino based arcade. I want each user of the arcade to have an RFID card that stores the amount of credits (basically money) they have. I know that RFID tags have 1028 bytes of storage on them, but I don't know how to write an integer value to them.
The amount of credits each user has would be stored on the RFID, as well as their PIN.
The PIN would be 4 digits, with each digit an integer from 0-9, as is the standard with PINs. It would be stored as a single integer, between 0000 and 9999.
The credit would ALSO be stored on each card. This would be between 0 and 99 (Most that can be loaded at a time). This, too, would be treated as a single integer, for ease of use.
Both integers would be of the Arduino type int
.
I am using the MFRC522 library with an RC522 reader/writer. I have an Arduino Uno, but can easily switch to an Arduino Nano.
Can someone tell me how to:
A. Write an integer value (stored as a variable in the sketch or accessed from the RFID memory) to an RFID card?
B. Access that information and retrieve it as an integer I could operate on (+,-,÷,×, etc
)?
Thanks in advance!