I have been trying to get the NRF24L01 to transmit the "hello World", Though the devices are talking to each other they are reading scrambled data. I have looked everywhere for support but unfortunately tried solutions as much as I can. I have attached the code below and the output.
The steps for fixing from my side:
- Checked the wiring
- rechecked the code and the address
- Used a capacitor
- Changed the baud rate to the transceiver specification and random baud rates
I need a new perspective please help!!
Transmitter:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 myradio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
myradio.begin();
myradio.openWritingPipe(address);
myradio.setPALevel(RF24_PA_MIN);
myradio.stopListening();
}
void loop() {
const char text[] = "Hello World";
myradio.write(&text, sizeof(text));
}
Receiver:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 myradio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
myradio.begin();
myradio.openReadingPipe(0,address);
myradio.setPALevel(RF24_PA_MIN);
myradio.startListening();
}
void loop() {
if (myradio.available()) {
char text[32] = " ";
myradio.read(&text, sizeof(text));
Serial.println(text);
}
}
I would like to add I have some basic knowledge of Arduino.
Output: ?????????????????????????????????/
????????????????????
??????????????????????????????????
???????????????????????