I am working on an automation project that uses NRF24L01 modules connected to an Arduino UNO(the receiver) and Arduino Nano(the transmitter). I have done the connections correctly. The receiver end doesn't work (the relay is not turning on) even though the transmitter is transmitting the message with the same address. What seems to be the issue here?
//Transmitter code
include //NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
include
include
int SentMessage[1] = {111}; RF24 radio(7,8); // NRF24L01 used SPI pins + Pin 9 and 10 on the NANO
const byte address[6] = "node1"; // Needs to be the same for communicating between 2 NRF24L01
void setup() { // pinMode(SwitchPin, INPUT_PULLUP); // digitalWrite(SwitchPin,HIGH);
radio.begin(); // Start the NRF24L01 radio.openWritingPipe(address); // Get NRF24L01 ready to transmit }
void loop() {
}
//Receiver Code
include
include
include
int RELAY=4; RF24 radio(7, 8); // CE, CSN int receivedMessage[1] = {111}; const byte address[6] = "node1"; void setup() { // Serial.begin(9600); radio.begin(); radio.openReadingPipe(1, address); // radio.setPALevel(RF24_PA_MIN); radio.startListening(); pinMode(RELAY,LOW); }
void loop() { while(radio.available()) { radio.read(receivedMessage,1);
// delay(2); } }
I am working on an automation project that uses NRF24L01 modules connected to an Arduino UNO(the receiver) and Arduino Nano(the transmitter). I have done the connections correctly. The receiver end doesn't work (the relay is not turning on) even though the transmitter is transmitting the message with the same address. What seems to be the issue here?