NRF24l01 LED control

Hi, I've been developing a code to control a led with an arduino attached to an NRF24l01+ transceiver. The code worked fine until recently. When I use the arduino the LED just goes on and the code bypasses the transceiver completely

Here's the code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//int msg[1];
int ReceivedMessage[1] = {000}; // Used to store value received by the NRF24L01
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 3;



void setup(void){
Serial.begin(9600);
radio.begin();
radio.setPALevel (RF24_PA_MAX);
radio.setDataRate (RF24_250KBPS);
radio.openReadingPipe(1,pipe);
radio.startListening();
pinMode(LED1, OUTPUT);}

void loop(void){
while (radio.available()){
radio.read(ReceivedMessage, 1); // Read information from the NRF24L01
if (ReceivedMessage[0] == 111)
{delay(10);digitalWrite(LED1, LOW);}
else {digitalWrite(LED1, HIGH);}
delay(10);}}
//else{Serial.println("No radio available");}}

My question is: how come the arduino is bypassing the radio signal and just outputting to pin 3?
Everything worked fine but after detaching some wires and hooking them up again it did the bypass

Bri913:
My question is: how come the arduino is bypassing the radio signal and just outputting to pin 3?

I don't understand that.

Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

And try the connection test program to make sure your Arduinos are communicating with the nRF24s that they are attached to.

...R