Hello
I use nrf24l01 PA + LNA modules with the RF24 library. I managed to make them interract ("the radio .available() function returns true and the reading loop begins normally but the message can not be displayed in the serial monitor. I would like to fix this problem of empty message. The codes below are some test codes, the initial project is to build an RC car and I'm currently working on the remote control system.
Emmission code :
#include <SPI.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
void setup() {
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(0xF0F0F0F0E1LL); // Adresse de transmission (5 octets)
}
void loop() {
char message[] = "Hello, Receiver!"; // Message à envoyer
radio.write(&message, sizeof(message)); // Envoie le message
Serial.println("Message envoyé : " + String(message));
delay(1000);
}
Reception code :
#include <SPI.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, 0xF0F0F0F0E1LL); // Adresse de réception (5 octets)
radio.startListening();
}
void loop() {
if (radio.available()) {
char message[32] = ""; // Tampon pour stocker le message reçu
radio.read(message, sizeof(message)); // Lit le message reçu
Serial.println("Message reçu : " + String(message));
}
delay(1000);
}
I've been struggling on this for the last month and I really could use some advice