Arduino BT and RFID UM005 READER

hello

I try to connect an Arduino BT and a RFID reader UM0005.
I use the SoftwareSerial library to creat a new serial port. But I’ve no idea how to parse the RFID code without a Myserial.available ?

// library Serial for use another pin as serial 
#include <SoftwareSerial.h>

//  software RX and TX
#define RfidRX 6
#define RfidTX 8

//  List code RFID
int bytesread=0; // counter RFID list
int codeRFID[] = { 0,0,0,0,0,0,0,0,0,0 };

// software serial port RFID
SoftwareSerial myRfidSerial =  SoftwareSerial(RfidRX, RfidTX);

/// 
int RFIDByte = 0;      // for incoming serial data


////// pind  test
int LED = 13;   // select the pin for the LED
int RESET = 7;


void setup() {

  pinMode(LED,OUTPUT);   // declare the LED's pin as output
  pinMode(RESET,OUTPUT);   // declare the LED's pin as output
  Serial.begin(115200);        // connect to the serial port
  digitalWrite(RESET, HIGH);
  delay(10);
  digitalWrite(RESET, LOW);
  delay(2000);
  Serial.println("SET BT PAGEMODE 3 2000 1");
  Serial.println("SET BT NAME ARDUINOBT");
  Serial.println("SET BT ROLE 0 f 7d00");
  Serial.println("SET CONTROL ECHO 0");
  Serial.println("SET BT AUTH * 12345");
  Serial.println("SET CONTROL ESCAPE - 00 1");
  Serial.println("SET CONTROL BAUD 115200,8n1");      //first release 19200


  // set the data rate for the SoftwareSerial port for RFID um005
  pinMode(RfidRX, INPUT);
  pinMode(RfidTX, OUTPUT);

  myRfidSerial.begin(9600);


}

void loop () {
    // read the incoming RFID code

   // if (myRfidSerial.available>0){ ?????
    RFIDByte =myRfidSerial.read();
    
   
   

}

I already connected the UM005 reader with an serial-USB FTID to communicat with Processing :

 if ( myPort.available() > 0) {  // If data is available,
    val = myPort.read();         // read it and store it in val
  }
  
  if (val==1){
     bytesread = 0; 
      while(bytesread<10) {              // 
        if( myPort.available() > 0) { 
          val =  myPort.read(); 
          codeRFID[bytesread] = val;         // add another value in the array      
          bytesread++;                   //next value in the list   
        } 
     } 
  }
    
    if(bytesread == 10) {              // if 10 lecture complete 
        println("TAG RFID : ");   // codeRFID de mon stransponder
        println(codeRFID);            // print codeRFID
        bytesread = 0;           //reset counter
      }

If you have an idea?
THANX :slight_smile:

ok I've found the solution with the NewSoftSerial.h library :D