Nrf_communication_suffers

hi, will be short
both arduino unos
this is sender arduino code:

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

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

const byte address[6] = "00001";

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

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

this is receiving arduino

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

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

const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(1, address);
  radio.setPALevel(RF24_PA_HIGH);
  radio.startListening();
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

in result I receive "Hello arduino" 1 time, and then silence, but in the code I need to get the message every second
thanks
image

The high power devices need to be quite far apart to avoid overloading the receivers of each device.

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