Step 3: The code
I don't make any kind of checksum at the tags code, but it seems to work fine.
The code is really simple. I used a new library for the serial, using software emulation.
With the two white cards you can deny or allow the access of others keys.
Any doubt, please ask me.
Edit (05/11/12):
code update for new Arduino version
Remove these ads by
Signing Up







































Visit Our Store »
Go Pro Today »




Tx from RFID board goes to Digital PIN 5 on Arduino Board, not PIN 2.
But the old sketch is point at PIN 2, so I think that why some people said that's not work.
Please help me fix this!
You can find here: http://arduiniana.org/libraries/newsoftserial/
you can find words:
*****************************************************************************************
"The latest version of NewSoftSerial is available here: NewSoftSerial12.zip. Note: donât download this if you have Arduino 1.0 or later. As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial)."
*****************************************************************************************
This means that on Arduino 1.0 and later this library named SoftwareSerial!
Thats why your program does not work...
1.Green excepted
2.red denied
3.yellow ready for an RFID card reprogramming
This would also make it easier for for people like me to connect a motor to the place the led was.
Thank you very much.
When I uncommented the println statements in the reading loop it worked as expected, so it seems that the program was trying to read the bytes too fast. After the first byte is read it loops back to test if another byte is waiting, and if it is not, then the loop exits with the string 'msg' just one byte long.
It works when the println is executed, because then there is always time for the next byte to arrive before RFID.available is called.
The solution is to add an explicit delay:
while(RFID.available()>0){
c=RFID.read();
msg += c;
delay(1); //allow time for another byte to arrive
//Serial.println(msg); //Uncomment to view your tag ID
//Serial.println(msg.length());
}
If it does not work, plz tell me.
When I saw your example and changed to the NewSoftwareSerial, it instantly fixed the problem.
E vc e' Brasileiro ne'?! =D
Se precisar de algo, pede ae.
Abrass
ou seja uma pagina simples em que tenha um ON e OFF via ethernet atravez dele....
email : lx.nuno.rodrigues@gmail.com
OBS : Estou a usar o Arduino Uno + Ethernet Shield ( com MiniSD )
Tente usar este tutorial, duvida me pergunta.
http://www.instructables.com/id/Ethernet-Shield-LED-WEB-SERVER/
http://arduiniana.org/libraries/NewSoftSerial/
cya