Store ID tag numbers to one variable?
![Luis_P](https://forums.parallax.com/uploads/userpics/943MO9HECKJ3/nO7HZN7DAZ7N6.jpeg)
The project I'm working on reads the unique serial number on FOB KEY tag. The code use an array to SERIN one number at the time and DEBUG on screen . I need to combine all the numbers EX: 3501D5BDE2 and temporary store into one Variable. I want to do that so later in my code I can debug the names of ID holders, EX: IF 3501D5BDE2 THEN DEBUG "John Smith"
Main:
DEBUG "Ready..." ' Read unique ID from EM4102 read-only tag
Read_Legacy:
SEROUT RFID_TX, Baud, ["!RW", RFID_ReadLegacy]
SERIN RFID_RX, Baud, [STR buf\12] ' Get header and data
IF buf(0) <> $0A THEN Read_Legacy ' If we don't receive the correct header, keep trying until we do
FOR idx = 1 TO 10 ' Display the data (ignore final \r byte sent by the reader)
DEBUG buf(idx)
NEXT
DEBUG CR
DEBUG STR buf\12 '<= THIS DISPLAY ALL THE NUMBERS FROM THE ID TAG
PAUSE 1000
goto Main
Main:
DEBUG "Ready..." ' Read unique ID from EM4102 read-only tag
Read_Legacy:
SEROUT RFID_TX, Baud, ["!RW", RFID_ReadLegacy]
SERIN RFID_RX, Baud, [STR buf\12] ' Get header and data
IF buf(0) <> $0A THEN Read_Legacy ' If we don't receive the correct header, keep trying until we do
FOR idx = 1 TO 10 ' Display the data (ignore final \r byte sent by the reader)
DEBUG buf(idx)
NEXT
DEBUG CR
DEBUG STR buf\12 '<= THIS DISPLAY ALL THE NUMBERS FROM THE ID TAG
PAUSE 1000
goto Main
Comments
Is possible to use RW tags and instead of a numbers store a name in the tag? so that way the tag reads a person name?