Help with Arduino AC Light control project.

Hi, I’m trying to control an AC Light, with Arduino and NRF24L01 RF Modules, everything is pretty much done, but instead of having an On/Off Status, I have an Off and a blinking light instead of it being completely on, I’m using a normal switch connected to the Arduino, and other Arduino to use it as a receiver.

The code is posted below.
Thanks.

remote_3.ino (315 Bytes)

receiver_led3.ino (591 Bytes)

HuCG1804:
Hi, I’m trying to control an AC Light, with Arduino and NRF24L01 RF Modules, everything is pretty much done, but instead of having an On/Off Status, I have an Off and a blinking light instead of it being completely on, I’m using a normal switch connected to the Arduino, and other Arduino to use it as a receiver.

The code is posted below.
Thanks.

I found this “RF24 Class Reference” …

bool RF24::available ( uint8_t * pipe_num )
Test whether there are bytes available to be read.
Use this version to discover on which pipe the message arrived.

Parameters:
[out] pipe_num Which pipe has the payload available

Returns:
True if there is a payload available, false if none is

but you have this …

if (radio.available()){

without the PIPE parameter ?

Could that be the problem?
Unless your RF24 Library is different?
If not then how could the code compile without an error?

Also …

Q1) How often does your Receiver display “Radio not available” ?
Does it constantly re-display, over & over & over, when SW1 is OFF?

Q2) You send Message #111 for ON, but what Message #xxx do you send for OFF?

I was thinking, the “sender” should only send a Message on Change-Of-State of SW1 ?
When SW1 changes from OFF to ON then Send Message #111, one time.
When SW1 changes from ON to OFF then Send Message #112, one time.