I get nothing in my serial plotter while everything is on and should work.
Does anyone know what I am doing wrong or what else I can test?
Greetings Justin
if find it a good idea after radio.begin() to check the connection, e.g.
void setup() {
Serial.begin(115200);
delay(3000);
Serial.println("\n\nNano > NRF24L01 Receive");
radio.begin();
if (radio.isChipConnected())
Serial.println("Receiver NF24 connected to SPI");
else {
Serial.println("NF24 is NOT connected to SPI");
while (1)
;
}
tells you that the basic SPI connection is working or not
Thanks for the response,
i replaced the arduino mega with an arduino nano.
i added the code and both the arduino uno and the nano both showed Nano > NRF24L01 Receive Receiver NF24 connected to SPI.
The codes are now as follows:
arduino uno
/*
* Arduino Wireless Communication Tutorial
* Example 1 - Receiver Code
*
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
delay(3000);
Serial.println("\n\nNano > NRF24L01 Receive");
radio.begin();
if (radio.isChipConnected())
Serial.println("Receiver NF24 connected to SPI");
else {
Serial.println("NF24 is NOT connected to SPI");
while (1)
;
}
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
arduino nano
/*
* Arduino Wireless Communication Tutorial
* Example 1 - Transmitter Code
*
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
Serial.begin(9600);
delay(3000);
Serial.println("\n\nNano > NRF24L01 Receive");
radio.begin();
if (radio.isChipConnected())
Serial.println("Receiver NF24 connected to SPI");
else {
Serial.println("NF24 is NOT connected to SPI");
while (1)
;
}
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
Unfortunately my serial monitor remains completely empty after the Nano > NRF24L01 Receive Receiver NF24 connected to SPI message.
I am also now using an external power supply.