- This topic has 0 replies, 1 voice, and was last updated 13 years, 1 month ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
|
hello everyone….. i am having a problem with interfacing arduino to the parallax rfid read/write module…i want to write data in the tags but when i start to upload the codes to my arduino…. the serial monitor display.. error code 2… could not find listen windows(LIW)….here is the code i use comming from net…
#include <SoftwareSerial.h>
#define RFID_WRITE 0x02
#define txPin 6
#define rxPin 8
#define whichSpace 4
#define first 1
#define second 26
#define third 3
#define fourth 27
SoftwareSerial mySerial(rxPin, txPin);
void setup()
{
Serial.begin(9600);
Serial.println("RFID Write Test");
mySerial.begin(9600);
pinMode(txPin, OUTPUT);
pinMode(rxPin, INPUT);
}
void loop()
{
int val;
mySerial.print("!RW");
mySerial.write(byte(RFID_WRITE));
mySerial.write(byte(whichSpace));
mySerial.write(byte(first));
mySerial.write(byte(second));
mySerial.write(byte(third));
mySerial.write(byte(fourth));
if(mySerial.available() > 0)
{
val = mySerial.read();
if (val == 1) //If data was written successfully
{ Serial.println("Data written succesfully!");
}
else Serial.println("ERROR");
}
delay(250);
}
i got it from the arduino tutorial…. i am seeking your help to shed some light in our project….thanks in advance hope someone will reply