Hi im trying to work with NRF24L01 and voltage stabilizer but i ran into problem with communication between this 2 modules. I connected both modules according to the image below. I "wrote" code for transmitter
:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8);
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.stopListening();
}
void loop() {
const char text[] = "nrftest";
radio.write(&text, sizeof(text));
delay(2000);
}
and receiver:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8);
const byte address[6] = "00001";
void setup() {
// Konfiguracja
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.startListening();
}
void loop() {
char text[32] = "";
if (radio.available()) {
radio.read(&text, sizeof(text));
String transData = String(text);
if (transData == "nrftest") {
Serial.println("Kal");
}
}
}
And It doesn't work. Anyone have some idea?