Hello, I'm trying to learn wireless communication on Arduino. I chose nRF24L01. I have tried several guides and each time it is the same, i.e. the transmitter's serial monitor sends that it has sent and the receiver's serial monitor has not receive anything.
Below I am sending how I connected the module.
GND arduino
VCC 3.3V Arduino
CE 9
CS 10
MOSI 11
MISO 12
SCK 13
Transmitter code:
#include <SPI.h> //SPI support library
#include <nRF24L01.h> //library to support a given module
#include <RF24.h> //base library for the RF2 module family
const uint64_t pipe = 0x3A5CD94F26LL;
RF24 radio(9, 10); // assign CE and CS pins to the module
int a;
void setup() {
Serial.begin(9600);
radio.begin(); //run the module
radio.setChannel(76);
radio.openWritingPipe(pipe); //set the module to upload mode
a=1;
}
void loop() {
a=a+1;
radio.write(a, sizeof(int));
Serial.println(a);
delay(1000);
Receiver code
#include <SPI.h> //SPI support library
#include <nRF24L01.h> //library to support a given module
#include <RF24.h> //base library for the RF2 module family
const uint64_t pipe = 0x3A5CD94F26LL;
RF24 radio(9, 10); //assign CE and CS pins to the module
int a;
void setup() {
Serial.begin(9600);
radio.begin(); //run the module
radio.openReadingPipe(1,pipe); //set the module to receive mode
radio.startListening(); //start listening (receiving) data
a=0;
}
void loop() {
if ( radio.available() ) //checks whether there is data to receive,
{ //if so:
radio.read(a,sizeof(int)); //receive data and save to a variable of length
Serial.println(a);
delay(100);
}
}
I tried with only the CE and CS pins connected and with all of them, I noticed that when I connect the miso pin to the receiver, it stops displaying further information on the serial monitor.