Transmitter:-
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
RF24 radio(7, 8); // nRF24L01 (CE,CSN)
RF24Network network(radio); // Include the
radio in the network
const uint16_t node01 = 01; // Address of our node
in Octal format ( 04,031, etc)
const uint16_t master00 = 00; // Address of the
other node in Octal format
const unsigned long interval = 10; //ms // How
often to send data to the other unit
unsigned long last_sent; // When did we last
send?
void setup() {
[Link](9600);
[Link]();
[Link]();
[Link](90, node01); //(channel, node
address)
[Link](RF24_PA_MIN);
[Link]();
}
void loop() {
int output_value = analogRead(A0);
output_value = map(output_value,550,0,0,100);
[Link](output_value);
delay(1000);
RF24NetworkHeader header(master00); //
(Address where the data is going)
bool ok = [Link](header, &output_value,
sizeof(output_value)); // Send the data
delay(1000);
}
RECIEVER:-
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
RF24 radio(3,4); // nRF24L01 (CE,CSN)
RF24Network network(radio); // Include the
radio in the network
const uint16_t this_node = 00; // Address of this
node in Octal format ( 04,031, etc)
const uint16_t node01 = 01; // Address of the
other node in Octal format
#include<LiquidCrystal.h> //
Including lcd display library
LiquidCrystal lcd (5,6,7,8,9,10); // Define
LCD display pins RS,E,D4,D5,D6,D7
void setup() {
[Link]();
[Link]();
[Link](90, this_node); //(channel, node
address)
[Link](RF24_PA_MIN);
[Link]();
[Link](16,2); // setting LCD
as 16x2 type
[Link](0,0);
[Link]("my work");
[Link](0,1);
[Link]("ArduinoInterrupt");
delay(3000);
[Link]();
}
void loop() {
[Link]();
if( [Link]() )
{ while( [Link]() )// Is there any
incoming data?
{
delay(10);
RF24NetworkHeader header(node01);
int incomingData;
[Link](header, &incomingData,
sizeof(incomingData)); // Read the incoming data
[Link]("1:");
[Link]("interrupt");
[Link](0,1);
[Link]("Interrupt 1");
delay(3000);
[Link]();
}
}