nRF24L01 and UNO R3

Hello, can you please help me? Im using two arduino unos R3 and two nrf24L01 modules. One is tx and another rx. With tx in want to control one led with button. I want that, when the button is pressed, the led status is “ON” else its “OFF”. It wont work and I have no more ideas what to do. The circuit is the same as shown in this two photos: nRF24L01+ Basic Control LED (Arduino) | Elec-Cafe.Com Thank you!

TX code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int SW1 = 7;

void setup(void){
pinMode(4, INPUT);
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);}

void loop(void){
if (digitalRead(SW1) == HIGH){
msg[0] = 111;
radio.write(msg, sizeof(msg));}}

RX code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED1 = 7;

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

void loop(void){
if (radio.available()){
bool done = false;
while (!done){
done = radio.read(msg, sizeof(msg));
Serial.println(msg[0]);
if (msg[0] == 111){delay(10);digitalWrite(LED1, HIGH);}
else {digitalWrite(LED1, LOW);}
delay(10);}}
else{Serial.println("No radio available");}}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

@nv5, it is not polite to hijack another person's Thread with your question. I have suggested to the Moderator to move your Post to its own Thread.

In the meantime have a look at this Simple nRF24L01+ Tutorial

...R

so what i need to do now ???

Click [u]Report to moderator[/u]. Ask for the thread to be split (@Robin2 did that for you).

Thread split.

nv5:
so what i need to do now ???

Have you studied my tutorial?

…R

yes, when in come near nrf24l01 module with hand, the led start working but when i press button nothing happens it is still blinking ... in serial interface is written "no radio available"

nv5: yes, when in come near nrf24l01 module with hand, the led start working but when i press button nothing happens it is still blinking ... in serial interface is written "no radio available"

Which of my tutorial programs are you using?

Post the actual code that YOU have uploaded to your two Arduinos and post a sample of the output that they both produce.

...R