arduino interfacing with parallax rfid read/write module problem

1 post / 0 new
alex
reuno27's picture
Offline
Joined: 20/01/2012
Posts: 1
Points: 105
arduino interfacing with parallax rfid read/write module problem

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