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