Hello everyone, I'm desperate, I've tried everything: buying antennas, changing the power supply voltage, changing programs... I've done many tutorials but nothing works. That's why I'm asking for your help .I use two RF24 antennas with their power module, for the transmitter it is an arduino nano card and for the receiver an arduino uno card.
transmitter program:
#include <SPI.h>
#include <RF24.h>
#define pinCE 7
#define pinCSN 8
#define tunnel "PIPE1"
RF24 radio(pinCE, pinCSN); // Instanciation du NRF24L01
const byte adresse[6] = tunnel;
const char message[] = "Hello World !!!"; maxi, avec cette librairie)
void setup() {
radio.begin();
radio.openWritingPipe(adresse);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
radio.write(&message, sizeof(message));
delay(1000);
}
receiver program:
#include <SPI.h>
#include <RF24.h>
#define pinCE 7
#define pinCSN 8
#define tunnel "PIPE1"
RF24 radio(pinCE, pinCSN);
const byte adresse[6] = tunnel;
char message[32];
void setup() {
Serial.begin(9600);
Serial.println("Récepteur NRF24L01");
Serial.println("");
// Partie NRF24
radio.begin();
radio.openReadingPipe(0, adresse);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
radio.read(&message, sizeof(message));
Serial.print("Message reçu : "); Serial.println(message);
}
}