You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
//Transmitter code
#include <nRF24L01.h> //NRF24L01 library created by TMRh20 https://github.com/TMRh20/RF24
#include <RF24.h>
#include <SPI.h>
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 <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
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?
The text was updated successfully, but these errors were encountered: