Arduino Yun and SoftwareSerial Error

356 views Asked by At

I am trying to connect an nrf24L01 module to the arduino yun and it prints are gibberish.

this is my code:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 3); // RX, TX
void setup() 
{ 
Serial.begin(9600); 
while (!Serial) { 
;// wait for serial port to connect. Needed for Leonardo only 
}

Serial.println("Goodnight moon!");
mySerial.begin(115200); 
mySerial.println("Hello, world?");}
void loop() { 
if (mySerial.available()) 
    Serial.write(mySerial.read()); 
if (Serial.available()) 
    mySerial.write(Serial.read());
}


This is the output:

Goodnight moon!0'ÚšÚ‚ÚŠ¢Ú:…Ñ•Ý…å�šÑ…ÉÐÕp complete.

It should be:

0;0;3;9;0 Gateway startup complete.

Not sure about the numbers but I'm sure about the text

1

There are 1 answers

0
JoB On

The speed difference is too much I think. I would increase
Serial.begin(9600);
to
Serial.begin(115200);
or even better set both values to lower speeds. something like 38400