ببخشید اینم گیرنده
#include <nRF24L01.h>
//#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

//#include <nRF24L01.h>
//#include "printf.h"
//#include <RF24.h>
//#include <RF24_config.h>


//#include <RF24_config.h>

#include <SPI.h>
//#include <nRF24L01.h>
//#include <RF24.h>

//#include <Wire.h>
//#include <LiquidCrystal_I2C.h>

//LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display


/*-----( Declare Constants and Pin Numbers )-----*/
//#define CE_PIN 9
//#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t pipes[6] = {0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL, 0xF0F0F0F0C3LL,0xF0F0F0F0C4LL,0xF0F0F0F0C5LL,0xF0F 0F0F0C6LL };
/*-----( Declare objects )-----*/
RF24 radio(9, 10); // Create a Radio
/*-----( Declare Variables )-----*/

byte joystick[30]; // 2 element array holding Joystick readings
//byte joystickk[12];
//byte joystickk1[18];
//byte joystickk2[24];

void setup() /****** SETUP: RUNS ONCE ******/
{
Serial.begin(9600);
delay(1000);
Serial.println("Nrf24L01 Receiver Starting");
radio.begin();
radio.openReadingPipe(1, pipes[1]);
radio.openReadingPipe(2, pipes[2]);
radio.openReadingPipe(3, pipes[3]);
radio.openReadingPipe(4, pipes[4]);


radio.startListening();;
// lcd.init(); // initialize the lcd
// lcd.backlight();
}//--(end setup )---


void loop() /****** LOOP: RUNS CONSTANTLY ******/
{
if ( radio.available() )
{
// Read the data payload until we've received everything
// bool done = false;
// while (!done)
// {

// radio.read(joystickk2, 24);
//for(int i=18;i<24;i++){

//}
// Fetch the data payload

// radio.read( joystick, sizeof(joystick) );
// radio.read( joystickk, sizeof(joystickk) );
// radio.read( joystickk1, sizeof(joystickk1) );
radio.read(joystick, 30);
//for(int i=0;i<=5;i++){




Serial.print("Humidity :");
Serial.print(joystick[0]);
Serial.print("%\t");
Serial.print("Temperature :");
Serial.print(joystick[1]);
Serial.print("*C\t");
Serial.print(F(" Dust :"));
Serial.print(joystick[2]);
Serial.print(F("mg/m^3\t"));
// delay(500);

Serial.print(" You are heading");
if (((joystick[3]) < 30.5) || ((joystick[3]) > 337.5 ))
Serial.print(" South\t");
if (((joystick[3]) > 30.5) && ((joystick[3]) < 50.5 ))
Serial.print(" South-West\t");
if (((joystick[3]) > 50.5) && ((joystick[3]) < 75.5 ))
Serial.print(" West\t");
if (((joystick[3]) > 75.5) && ((joystick[3]) < 140.5 ))
Serial.print(" North-West\t");
if (((joystick[3]) > 140.5) && ((joystick[3]) < 185.5 ))
Serial.print(" North\t");
if (((joystick[3]) > 185.5) && ((joystick[3]) < 200.5 ))
Serial.print(" NorthEast\t");
if (((joystick[3]) > 200.5) && ((joystick[3]) < 260.5 ))
Serial.print(" East\t");
if (((joystick[3]) > 260.5) && ((joystick[3]) < 337.5 ))
Serial.print(" SouthEast\t");

if ((0 < (joystick[3])) && ((joystick[3]) < 180) )
{
(joystick[3]) = (joystick[3]);
}
else
{
(joystick[3]) = 360 - (joystick[3]);
}

Serial.print(" CO2 ppm :");
Serial.print(joystick[4]);
Serial.print(" rpm :");
Serial.println(joystick[5]);
// Fetch the data payload




Serial.print("Humidity1 :");
Serial.print(joystick[6]);
Serial.print("%\t");
Serial.print("Temperature1 :");
Serial.print(joystick[7]);
Serial.print("*C\t");
Serial.print(F(" Dust1 :"));
Serial.print(joystick[8]);
Serial.print(F("mg/m^3\t"));
// delay(100);

Serial.print(" You are heading1");
if (((joystick[9]) < 30.5) || ((joystick[9]) > 337.5 ))
Serial.print(" South\t1");
if (((joystick[9]) > 30.5) && ((joystick[9]) < 50.5 ))
Serial.print(" South-West\t");
if (((joystick[9]) > 50.5) && ((joystick[9]) < 75.5 ))
Serial.print(" West\t");
if (((joystick[9]) > 75.5) && ((joystick[9]) < 140.5 ))
Serial.print(" North-West\t");
if (((joystick[9]) > 140.5) && ((joystick[9]) < 185.5 ))
Serial.print(" North\t");
if (((joystick[9]) > 185.5) && ((joystick[9]) < 200.5 ))
Serial.print(" NorthEast\t");
if (((joystick[9]) > 200.5) && ((joystick[9]) < 260.5 ))
Serial.print(" East\t");
if (((joystick[9]) > 260.5) && ((joystick[9]) < 337.5 ))
Serial.print(" SouthEast\t");

if ((0 < (joystick[9])) && ((joystick[9]) < 180) )
{
(joystick[9]) = (joystick[9]);
}
else
{
(joystick[9]) = 360 - (joystick[9]);
}

Serial.print(" CO2 ppm1 :");
Serial.print(joystick[10]);
Serial.print(" rpm1 :");
Serial.println(joystick[11]);
// else if (
Serial.print("Humidity2 :");
Serial.print(joystick[12]);
Serial.print("%\t");
Serial.print("Temperature2 :");
Serial.print(joystick[13]);
Serial.print("*C\t");
Serial.print(F(" Dust2 :"));
Serial.print(joystick[14]);
Serial.print(F("mg/m^3\t"));
//delay(500);

Serial.print(" You are heading2");
if (((joystick[15]) < 30.5) || ((joystick[15]) > 337.5 ))
Serial.print(" South\t1");
if (((joystick[15]) > 30.5) && ((joystick[15]) < 50.5 ))
Serial.print(" South-West\t");
if (((joystick[15]) > 50.5) && ((joystick[15]) < 75.5 ))
Serial.print(" West\t");
if (((joystick[15]) > 75.5) && ((joystick[15]) < 140.5 ))
Serial.print(" North-West\t");
if (((joystick[15]) > 140.5) && ((joystick[15]) < 185.5 ))
Serial.print(" North\t");
if (((joystick[15]) > 185.5) && ((joystick[15]) < 200.5 ))
Serial.print(" NorthEast\t");
if (((joystick[15]) > 200.5) && ((joystick[15]) < 260.5 ))
Serial.print(" East\t");
if (((joystick[15]) > 260.5) && ((joystick[15]) < 337.5 ))
Serial.print(" SouthEast\t");

if ((0 < (joystick[15])) && ((joystick[15]) < 180) )
{
(joystick[15]) = (joystick[15]);
}
else
{
(joystick[9]) = 360 - (joystick[9]);
}

Serial.print(" CO2 ppm2 :");
Serial.print(joystick[16]);
Serial.print(" rpm2 :");
Serial.println(joystick[17]);
Serial.print("Humidity3 :");
Serial.print(joystick[18]);
Serial.print("%\t");
Serial.print("Temperature3 :");
Serial.print(joystick[19]);
Serial.print("*C\t");
Serial.print(F(" Dust3 :"));
Serial.print(joystick[20]);
Serial.print(F("mg/m^3\t"));
// delay(500);

Serial.print(" You are heading3");
if (((joystick[21]) < 30.5) || ((joystick[21]) > 337.5 ))
Serial.print(" South\t1");
if (((joystick[21]) > 30.5) && ((joystick[21]) < 50.5 ))
Serial.print(" South-West\t");
if (((joystick[21]) > 50.5) && ((joystick[21]) < 75.5 ))
Serial.print(" West\t");
if (((joystick[21]) > 75.5) && ((joystick[21]) < 140.5 ))
Serial.print(" North-West\t");
if (((joystick[21]) > 140.5) && ((joystick[21]) < 185.5 ))
Serial.print(" North\t");
if (((joystick[21]) > 185.5) && ((joystick[21]) < 200.5 ))
Serial.print(" NorthEast\t");
if (((joystick[21]) > 200.5) && ((joystick[21]) < 260.5 ))
Serial.print(" East\t");
if (((joystick[21]) > 260.5) && ((joystick[21]) < 337.5 ))
Serial.print(" SouthEast\t");

if ((0 < (joystick[21])) && ((joystick[21]) < 180) )
{
(joystick[21]) = (joystick[21]);
}
else
{
(joystick[21]) = 360 - (joystick[21]);
}

Serial.print(" CO2 ppm3 :");
Serial.print(joystick[22]);
Serial.print(" rpm3 :");
Serial.println(joystick[23]);

// delay(500);

//Serial.print(joystickk2[i]);
// delay(500);

//}





//lcd.clear();

//lcd.setCursor(0,0);
//lcd.print("Channel: ");
//lcd.print(data[0]);

//lcd.setCursor(0,1);

//lcd.print("H: ");
//lcd.print(data[1]);
//lcd.print(" T: ");
//lcd.print(data[2]);

// } // delay(500);

}
else
{
Serial.println("No radio available");
//lcd.clear();
//lcd.print("No radio available");
// delay(500);
}

}//--(end main loop )---]
/*-----( Declare User-written Functions )-----*/

//NONE
//*********( THE END )***********