Nrf24l01 unreadable data output

im trying create my own remote control using nrf24l01 but the output is like this

␏?␡␡␡␡␡␡������������������������

␟␡␡␡␡␡��������������������������

this is the receiver code:

#include <Arduino.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//create an RF24 object
RF24 radio(9, 8);  // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00001";

void setup()
{
  while (!Serial);
    Serial.begin(9600);
  
  radio.begin();
  
  //set the address
  radio.openReadingPipe(0, address);
  
  //Set module as receiver
  radio.startListening();
}

void loop()
{
  //Read the data if available in buffer
  if (radio.available())
  {
    char text[32] = {0};
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

this is transmitter code:

#include <Arduino.h>
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9, 8); // CE, CSN

const byte address[6] = "00001";

void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}

Mismatching com speeds?

are you using 9600 bauds in the Serial monitor ?

yess, but sometimes it result right

i guess its right

Look at examples in the library , I think the baud rate is wrong .
The examples will show you .

115200 I think …

1 Like

Guess? Check it!
Serial monitor has its speed shown down to the right.

I have test it before and got the same result

validate your circuits and power by running one of the example code to ensure all is right

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.