[solved] RFID & Arduino Yun

Hello everyone,

I'm working on a RFID project using this tutorial : http://www.instructables.com/id/Arduino-and-RFID-from-seeedstudio/
Everything work find with my arduino Uno but I can't make it work on my arduino yun.

This is the code I use on both of them :

#include <SoftwareSerial.h>

String msg;

SoftwareSerial RFID(2, 3);

void setup()  
{
  Serial.begin(9600);
  Serial.println("Serial Ready");

  Serial.begin(9600);
  Serial.println("RFID Ready");
}

char c;

void loop(){
  
  while(Serial.available()>0){
    c=Serial.read(); 
    msg += c;
    Serial.print(msg);  //Uncomment to view your tag ID
  }
  if(msg.length()>10) Serial.println("");
  msg = "";
  
}

Even the "Serial.println("Serial Ready");" doesn't work (on arduino Yun) on the setup fonction, but if I put it on loop I see the message.

Have you an idea ?
Thank you,

Maxime

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Look in the YUN forum! Or check the use of serial on the leonardo - it's not the same as that for the Uno.

Mark

Hello,

I look on that.

Thank you

I found the solution on the leonardo's help : http://arduino.cc/en/Reference/SoftwareSerial

Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

the solution

#include <SoftwareSerial.h>

String msg;

SoftwareSerial RFID(10, 11);

void setup()  
{
  Serial.begin(9600);
  Serial.println("Serial Ready");

  RFID.begin(9600);
  Serial.println("RFID Ready");
}

char c;

void loop(){
  
  while(RFID.available()>0){
    c=RFID.read(); 
    msg += c;
    Serial.print(msg);  //Uncomment to view your tag ID
  }
  if(msg.length()>10) Serial.println("");
  msg = "";
  
}

Thank you Mark