transmitter and receiver nrf24l01

tx code

// rx\
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LED2 = 2;
int LED3 = 3;

void setup(void){
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
radio.setPALevel(RF24_PA_MIN);
pinMode(LED2, OUTPUT);
pinMode(3, OUTPUT);}

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

if (msg[0] == 222){delay(10);digitalWrite(3, HIGH);}
else {digitalWrite(3, LOW);}
delay(10);}





else{Serial.println("No radio available");}}

my sw1 and sw3 on d2 and d3 to arduino
and rx code:

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

void setup(void){
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);
radio.setPALevel(RF24_PA_MIN);}

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


}


this is schematic.

Problem: led on out 3 not light, only led on out 2, rx on serial see message sw1 and sw3 (111, and 222) bt rx no turn on led 3 only led 2. how to resolwe this problem?

I've not checked the code but if this is connected this way you probably have a power issue when trying to transmit

to make things simple you could use an nRF24L01+ Adapter Board

adaptor.png

and install your nrf24l01 component there

install.png

you power this with 5V from your arduino and you are usually good to go