This page is to Setup and Config nRF24L01
Hardware and Software
Hardware
nRF24L01
Software
Arduino IDE
Connect Arduino nano
CE and CSN can change to any PIN
Library Download
http://www.airspayce.com/mikem/arduino/RadioHead/index.html
https://github.com/TMRh20/RF24
This example is .Receive
This example is Send
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, rxAddr);
radio.startListening();
}
void loop()
{
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.print("Received : ");
Serial.println(text);
} else {
#include <SPI.h>
//Serial.println("No Singal");
//delay(500);
#include "nRF24L01.h"
}
#include "RF24.h"
}
int msg[1];
RF24 radio(7, 8);
const byte rxAddr[6] = "00001";
void setup()
{
Serial.begin(9600);
Serial.println("Start....");
radio.begin();
radio.setRetries(15, 15);
radio.openWritingPipe(rxAddr);
radio.stopListening();
}
char text[] = "Hello Sanki I'm Here !!";
int counter = 0;
void loop()
{
if (counter <10) {
text[0] = '0';
text[1] = char(counter + 97);
counter++;
} else {
counter = 0;
}
Serial.print("Sending.....");
radio.write(&text, sizeof(text));
Serial.print("OK : ");
Serial.println(text[1]);
delay(500);
}