Dear all,
We are students trying to do a project using UHF RFID and integrating it with arduino mega 2560. We tried to use the code below to get the response of the reader on the serial monitor:
#include "Arduino.h"
#define DEBUG
unsigned char incomingByte;
void sendIdentifyCmd ()
{
Serial.write (0x53);
Serial.write (0x57);
Serial.write (0x00);
Serial.write (0x03);
Serial.write (0xFF);
Serial.write (0x20);
Serial.write (0x34);
#ifdef DEBUG
Serial2.print (0x53);
Serial2.print (0x57);
Serial2.print (0x00);
Serial2.print (0x03);
Serial2.print (0xFF);
Serial2.print (0X20);
Serial2.print (0X34);
Serial2.println ();
#endif
}
void setup ()
{
Serial2.begin (115200);
Serial.begin (115200);
Serial2.println ("begin initial Serial!\n");
}
void loop ()
{
sendIdentifyCmd ();
delay (2);
while(Serial2.available () > 0)
{
int HEX = Serial.read();
incomingByte=Serial.read ();;
Serial2.print (incomingByte,HEX);
Serial2.print (' ');
}
Serial2.println ();
delay (1000);
}
When we bought the RFID reader we got a user manual in which there are some certain commands in hexa that have to be sent for the reader to response. For example we use
Send:53 57 00 03 FF 10 44
Recv:43 54 00 0D 00 10 01 14 11 C3 DD 93 8E 17 01 23 2A
to read system parameter.
Could anyone please guide me on what I should add, delete, or adjust?
Thank you.