I have built a project with a sparkfun ID-12 RFID reader and a vibration motor. I was able to get the RFID reader to read RFID cards properly with the following code:
'This program Reads RFID cards and displays the 10 digit HEX number in the terminal
Pause 2000
SetFreq M8
SerTxd( "Starting", CR, LF )
Do
Serin 2, N9600_8, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9
SerTxd( "Tag = ",#b0, " ", b1, " ", b2, " ", b3, " ", b4, " " )
SerTxd( b5, " ", b6, " ", b7, " ", b8, " ", b9, CR, LF )
Loop
The card are read properly in the terminal as:
Starting
Tag = 2 5 0 0 0 8 F F 1 A
I have 5 RFID cards. What I would like to happen is have the vibration motor buzz one time for RFID card tag #1, 2 buzzez for RFID card tag #2... etc.
I know how to make the buzzer go high and low. That is not the issue. I just do not know how to code my "if then statement" to take the output of the rfid reader and get the result I want. I have only been working with picaxe a month or so and probably know this is basic but I just need some guidance if anyone could help.
Thank You
'This program Reads RFID cards and displays the 10 digit HEX number in the terminal
Pause 2000
SetFreq M8
SerTxd( "Starting", CR, LF )
Do
Serin 2, N9600_8, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9
SerTxd( "Tag = ",#b0, " ", b1, " ", b2, " ", b3, " ", b4, " " )
SerTxd( b5, " ", b6, " ", b7, " ", b8, " ", b9, CR, LF )
Loop
The card are read properly in the terminal as:
Starting
Tag = 2 5 0 0 0 8 F F 1 A
I have 5 RFID cards. What I would like to happen is have the vibration motor buzz one time for RFID card tag #1, 2 buzzez for RFID card tag #2... etc.
I know how to make the buzzer go high and low. That is not the issue. I just do not know how to code my "if then statement" to take the output of the rfid reader and get the result I want. I have only been working with picaxe a month or so and probably know this is basic but I just need some guidance if anyone could help.
Thank You