Hello, I'm a beginner at Arduino and coding and I am building a drone with a homemade controller as a school project. Here are the schematics for the controller and receiver, ,
. I am powering both with 2 lipo batteries.
The problem I have is that I get no connection between the NRF24L01 modules and I have been troubleshooting trying different codes for the past 3 days.
The transmitter code looks like this.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(5, 6); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.setChannel(110); //set the channel
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
The receiver code looks like this.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(3, 2); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.setChannel(110); //set the channel
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
I have double-checked that there is no more than 3.3v going to the NRF24L01 module so as not to burn it. So far I haven't gotten any error messages its instead just silent on the receiving end.
Any help is very appreciated. Thanks!