Hello ! I have two nrf24l01. The receiver is a arduino nano and the transmitter is a arduino micro. When i turn them on, the arduino micro dosen't flash any led but the arduino nano flashes the tx led very fast. On the serial monitor i only see question marks.
My code:
Reciever
/*
- Arduino Wireless Communication Tutorial
- Example 1 - Receiver Code
- by Dejan Nedelkovski, www.HowToMechatronics.com
- Library: TMRh20/RF24, GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
*/
#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();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
Transmitter
/*
- Arduino Wireless Communication Tutorial
- Example 1 - Transmitter Code
- by Dejan Nedelkovski, www.HowToMechatronics.com
- Library: TMRh20/RF24, GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices
*/
#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();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
Wiring (same on both arduinos)