I am using em-18 rfid reader ,with following program.Why i am getting different tag id each time(only 3 or 4 digits differs ,while all other digit are same).
for more info::Contact | Jaycon Systems
#include <SoftwareSerial.h>
SoftwareSerial mySerial(0,1);
void setup()
{
Serial.begin(9600);
Serial.println("Scan RFID Tag!");
// set the data rate for the NewSoftSerial port
mySerial.begin(9600);
}
void loop() // run over and over again
{
if (mySerial.available())
{
Serial.print((int)mySerial.read());
}
if (Serial.available()) {
mySerial.print((int)Serial.read());
}
}
SoftwareSerial mySerial(0,1);
Why are you using the hardware serial pins for SoftwareSerial?
system
July 2, 2012, 12:05pm
3
i am using softwareserial for first time,
so please correct me ,if i have done something wrong .
system
July 2, 2012, 12:11pm
4
i am using softwareserial for first time,
so please correct me ,if i have done something wrong .
You have. The hardware serial pins are accessed using the Serial instance of the HardwareSerial class.
If you want to use SoftwareSerial, you must use two other pins. Of course, you must connect your device to those same two pins.
thanks for help ,Now it is working perfectly !!!