On my current project, I have RFID badges which sends a 10 chars ID to my Arduino UNO
(ex: 2700BBA0E8
). The doc says "Printable ASCII", but I don't know if it's always [0-9A-F]
.
On Arduino, the memory is limited:
char
is1 byte
int
is2 bytes
long
is4 bytes
an int
or a long
would be shorter than a char[10]
and simpler to compare (strcmp()
vs ==
), so I wonder how I can transform the 10 chars received one by one (on serial) to an int
or a long
?
Thanks for your help