Hello,
First off I was trying to get this example project to work but was having no luck so I went back to basics and paired down the program to a simple "Hello world" program and I am getting the same frustrating results. For the life of me, I can't get these nRF24 modules to communicate.
I have checked the pinout both on the nRF module as well as the SPI pinout on the Nano Every (CE and CSN are on pins 5 and 6 respectively), I have measured voltages from my 3.3v buck and checked the ground all the way back to the battery, and even tested for continuity on all data pins back and forth. I have tried two different modules, ones with the PCB antenna and a model with the long-range antennae, and can't even get it to send a simple string of characters.
I have also been using the nRF24 library reference to make sure I am supplying the proper arguments.
I've been at this an hour or two a day for at least the past week and I feel like I am ramming my head into a wall chasing possible errors. Can someone please take a look at even my basic code and tell me what I am doing wrong?
Transmitter Code
#include <SPI.h>
#include <RF24.h>
#include <nRF24L01.h>
#define CE_PIN 5
#define CSN_PIN 6
const uint8_t pipe[6] = "00001";
RF24 radio(CE_PIN,CSN_PIN);
char data[] = "Hello World";
void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
radio.begin();
radio.setPALevel(RF24_PA_MIN);
radio.openWritingPipe(pipe);
radio.stopListening();
}
void loop() {
// put your main code here, to run repeatedly:
radio.write( &data, sizeof(data));
}
Receiver Code
#include <SPI.h>
#include <RF24.h>
#include <nRF24L01.h>
#define CE_PIN 5
#define CSN_PIN 6
const uint8_t pipe[6] = "00001";
RF24 radio(CE_PIN, CSN_PIN);
char data[] = "";
void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
delay(1000);
Serial.println("nRF24L01 Receiver Starting");
radio.begin();
radio.setPALevel(RF24_PA_MIN);
radio.openReadingPipe(1, pipe);
radio.startListening();
}
void loop() {
// put your main code here, to run repeatedly:
if (radio.available())
{
radio.read( &data, sizeof(data));
Serial.println(data);
}
else
{
Serial.println("No radio available");
}
}