NRF24L01 Arduino nano

I have an NRF24L01 connected to my Arduino nano. I used the following link to get the receiver setup and the transmitter.

I am having issues using button 1 on the transmitter to send a command to turn on an LED on the receiver. Everything I have used so far works, including the potentiometers and the joysticks. When I use the serial print on the receiver data from button 1 change from 1 to 0 when the button is pressed. The led just doesn’t turn on. Attached is my sketch and wiring diagram.

Thanks for the help.

Reciever.ino (3.58 KB)

Is the LED wired backwards? The Anode needs to be + and the Cathode needs to be - or it will not work.

teschns:
I have an NRF24L01 connected to my Arduino nano. I used the following link to get the receiver setup and the transmitter.

DIY Arduino RC Transmitter - HowToMechatronics

I am having issues using button 1 on the transmitter to send a command to turn on an LED on the receiver. Everything I have used so far works, including the potentiometers and the joysticks. When I use the serial print on the receiver data from button 1 change from 1 to 0 when the button is pressed. The led just doesn't turn on. Attached is my sketch and wiring diagram.

Thanks for the help.

Haven't looked at your code, didn't get that far.
Fritzing shows your NRF unit connected to 5V which will have destroyed it.
Best to power these units below directly from a supply via an adaptor ( shown below), ie, not via the Arduino.

if (buttonValue1 = 0)

Wrong.

Unless, of course, you really do want to set buttonValue1 to zero rather than compare it to zero

blh64:
Is the LED wired backwards? The Anode needs to be + and the Cathode needs to be - or it will not work.

I checked the LED is wired correctly. This highlights an aspect of my original post that I may not have set up the fritzing correctly, my bad human error. I have the NRF wired to the 3v3 on the UNO, again bad wiring diagram. Would this affect my LED issues?

UKHeliBob:

if (buttonValue1 = 0)

Wrong.

Unless, of course, you really do want to set buttonValue1 to zero rather than compare it to zero

Can you expand on this? The Rx has a value of 1 when button 1 is not pressed and changes to 0 when pressed. My thinking is when buttonValue1 is 0 then it would set the LEDpin to high. I did also notice that line 82 the map function was missing to the data.button1. I attached an updated version of the sketch. Is line 82 correct? I am out of town for a while and will have to do a systems check when I get back.

I appreciate the time you all are taking out of your day to help me. Thank you so much.

Reciever.ino (3.59 KB)

As post #3 suggested....

is this what you're trying to do...??

https://www.arduino.cc/reference/en/language/structure/comparison-operators/equalto/

if (buttonValue1 = 0)

= is for assigning a value
== is for comparing a value

Is line 82 correct?

No
Currently it is as follows

  buttonValue1 = map(data.button1);

You have used the map() function completely wrongly
See map() function
The map() function requires 5 parameters

Thank you all so much the equalto was the issue. Sometimes it is the simplest thing that is often overlooked.

Thanks again.