i just received a rfid reader with some tags, but i have a communication problem with arduino.. i load the code below but in the serial monitor i can t see anything when i scan a tag.
rfid reader seems work correctly, when i scan a tag, the on the reader is on, but in serial monitor nothing appened
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); //pin2 Rx, pin3 Tx
void setup(){
Serial.begin(9600);
Serial.println("Seriale:\n");
mySerial.begin(9600);
mySerial.write(0x02);
}
void loop() // run over and over
{
if (mySerial.available())
Serial.println(mySerial.read(),HEX);
if (Serial.available())
mySerial.write(Serial.read());
}
Link?
Without further information it is hard to say what is going wrong.
Has the RFID reader got an RS232 output? If so are you converting it to TTL voltages before sending it into the arduino.
Have you got the TX & RX the right way round, depending on how the reader is designated you could have to connect TX to TX or TX to RX.
The code is a bit wrong as it will print every character on a new line but you should see something.
But as I said you should see something. You appere to be doing everything right, is the ground of the reader connected to the ground of the arduino?
Check that the wires are actually making contact.
If all theat files you need a scope to check the signals.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Now all works fine, thread can be closed, sorry XD