Hi,
I have a problem that I consider absurd
I have an Arduino UNO configured with a RDM 6300 and works PROPERLY
When I go to replace the RDM 6300 to Arduino MEGA 2560 with the SAME configuration but it does not work, it's incredible but why?
I am attaching a picture and code.
Please help, I'm going crazy for this
Thanks in advance.
********** THE CODE **********
// RFID
SoftwareSerial rfidReader(2,3); // Digital pins 2 and 3 connect to pins 1 and 2 of the RMD6300
String tagString;
char tagNumber[14];
void setup() {
Serial.begin(9600);
rfidReader.begin(9600); // the RDM6300 runs at 9600bps
Serial.println("AVVIATO");
}
void loop() {
while (rfidReader.available()){
int BytesRead = rfidReader.readBytesUntil(3,tagNumber, 15);//EOT (3) is the last character in tag
tagString=tagNumber;
Serial.println();
Serial.print("TAG=");
Serial.println(tagString);
Serial.write(255);
delay(2000);// a delay of 1500ms and a flush() seems to stop tag repeats
rfidReader.flush();
memset(tagNumber,0,sizeof(tagNumber)); //erase tagNumber
}
Serial.println("CONTREOLLO");
delay(2000);// a delay of 1500ms and a flush() seems to stop tag repeats
}
*********** IMAGE ******************