Hi Bu11Billy,
could you post your code please ?
i am cracking my head for hours on this now but i can't
get it to read a 125khz card... i am currently using the code that is posted earlier in this topic and the led on the RFID reader turns red for a second or so and then just goes green again.. it seems that it just stops at the
while(!mySerial.available())
is there anything else i need to do other then pass then !RW RFID_READ 32 ?
this is the complete code i am using now :
//Interface Arduino USB with Parallax 125 Khz UART RFID Reader/Writer
#include <NewSoftSerial.h>
#define rxPin 19
#define txPin 18
//Reader/Writer Commands
#define RFID_READ 0x01
#define RFID_WRITE 0x02
//Memory Locations for Data
#define DATA_ADDR_0 3
#define DATA_ADDR_1 4
//Error Codes
#define ERR_OK 0x01
NewSoftSerial mySerial(rxPin, txPin);
char statusCode;
void setup()
{
Serial.begin(9600);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
mySerial.begin(9600);
Serial.println("RFID Read/Write Test");
}
void loop()
{
Serial.println("Reading Tag Data...");
//1st 4 bytes
mySerial.print("!RW");
mySerial.print(RFID_READ, BYTE);
mySerial.print(32, DEC);
while(!mySerial.available())
{
//this is where it halts..
}
Serial.print("Read Status:");
statusCode = mySerial.read();
if(statusCode == ERR_OK)
{
Serial.println("OK");
Serial.print("RFID Data:");
Serial.print(mySerial.read(), BYTE);
Serial.print(mySerial.read(), BYTE);
Serial.print(mySerial.read(), BYTE);
Serial.println(mySerial.read(), BYTE);
}
else
{
Serial.print("NOT OK. Error Code:");
Serial.println(statusCode, HEX);
}
}
thanks in advance for your help ,
Stefkeh