Pages: [1]   Go Down
Author Topic: RFID, interpreting data.  (Read 390 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Newbie
*
Karma: 0
Posts: 31
wewt
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an ID12 RFID reader working with my arduino duemilanove - ie it is lighting the led when a tag is read and is outputting the correct serial information.

Im using the code from here:
http://www.arduino.cc/playground/Code/ID12

My question is how do i use the data to turn an led a certain colour for example. so i want to add a function like

if (code = 2800C4DCIF){
digitalWrite (LED1, HIGH); }


I need to convert the data its giving me but i dont know how to convert it or what to convert it to. A simple explanation of what i need to do would be brilliant. I think i need to convert it to a string or parse it or something. Im not sure so an example would be great.

Thanks
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
byte tag_verified[num_of_tags][6] = {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, {0x01, 0x01, 0x01, 0x01, 0x01, 0x01}}; //here put your tags


at the end of the code you found on the playground, (where it writes checksum passed or error)
put something like this:

Code:
byte i, current, verified = 0;
  for (current = 0; current < num_of_tags; current++){
    for (i = 0; i <= 5; i ++){
      if (code[i] != tag[current][i])
        break;
      if (i == 5 && (code[i] == tag[current][i]))
        verified = 1;
    }
    if (verified == 1)
      // put here your instructions
    break;
  }

« Last Edit: March 27, 2010, 05:07:13 am by Alexthebest » Logged

Pages: [1]   Go Up
Jump to: