Nrf24l01 not working

huron129:
I am beginner in arduino programming. I am working with nrf24l01 but the problem i am facing is that it is not working at all with uno and nano.
I have tried many examples available online but still the transmission between the two arduino is not happening. I have even soldered a 10uf capacitor to the modules and tried using different power source for nrf24l01.(tried these-base module,3.3v power source and a 5v 1A power source connected to base module). I am still not getting desired results please help.
Here is the code i am currently using for recieving

#include <SPI.h> 

#include <RF24.h
#define CE 7
#define CSN 8
const uint64_t ad= 0xE8E8F0F0E1LL;
RF24 radio(CE, CSN);
void setup()
{
pinMode(8, OUTPUT);
PinMode(7, OUTPUT);
Serial.begin(115200);
radio.begin();
radio.setChannel(108);
radio.setDataRate( RF24_250KBPS );
radio.setPALevel(RF24_PA_MIN);
radio.openReadingPipe(1, ad);
radio.startListening();
}
void loop()
{
 if(radio.available())
{
Unsigned long a=0;
radio.read(&a,sizeof(a));
Serial.println(a);
delay(500);
}




And this code for transmitter


#include <SPI.h>
#include <RF24.h>
#define CE 7
#define CSN 8
const uint64_t ad= 0xE8E8F0F0E1LL;
RF24 radio(CE, CSN);
void setup()
{
pinMode(8, OUTPUT);
PinMode(7, OUTPUT);
Serial.begin(115200);
radio.begin();
radio.setChannel(108);
radio.setDataRate( RF24_250KBPS );
radio.setPALevel(RF24_PA_MIN);
radio.openReadingPipe(ad);
}
void loop()
{
int a=100;
radio.write(&a,sizeof(a));
delay(500);
}





Please help me with if there is something wrong with my code and if i need to add more to it.

hi huron, check on this. super simple codes and library to communicate two arduino using nrf24l01.
you can find download link for the library on the comment.

modify this code :slight_smile:
here simple codes for tx:

#include <SPI.h>
#include <nRF24L01p.h>

nRF24L01p transmitter(7,8);//CSN,CE

void setup(){
  delay(150);
  Serial.begin(115200);
  SPI.begin();
  SPI.setBitOrder(MSBFIRST);
  transmitter.channel(90);
  transmitter.TXaddress("Artur");
  transmitter.init();
}

String message;

void loop(){
  if(Serial.available()>0){
    char character=Serial.read();
    if(character=='\n'){
      transmitter.txPL(message);
      transmitter.send(SLOW);
      message="";
    }else{
      message+=character;
    }
  }
}

here for rx:

#include <SPI.h>
#include <nRF24L01p.h>

nRF24L01p receiver(7,8);//CSN,CE

void setup(){
  delay(150);
  Serial.begin(115200);
  SPI.begin();
  SPI.setBitOrder(MSBFIRST);
  receiver.channel(90);
  receiver.RXaddress("Artur");
  receiver.init();
}

String message;

void loop(){ 
  if(receiver.available()){
    receiver.read();
    receiver.rxPL(message);
    Serial.println(message);
    message="";
  }
}