Thank you!!!....here is the code.
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"4L01.h"
#include "RF24.h"
#include "printf.h"
#include "printf.h"
//
// Hardware configuration
//
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);
uint8_t data[2]; //buffer to store received data
const uint8_t buffer_size = sizeof(data);
//pins that used for the Joystick
const int analogInPinY= A0; //
const int analogInPinX = A1;//
const int StearRight = 3;
const int StearLeft = 5;
const int tx_led=2;// transmission indicator
int Y_value = 0; // values read from the pot
int X_value = 0;
int outputValue = 0;
/*
const int transmit_pin=6;
int transmit_enable;
int ForwrdButton=2;
int BackwrdButton=3;
*/
//
// Topology
//
// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;
//
// Setup
//
void setup(void)
{
Serial.begin(9600);
printf_begin();
//
// Setup and configure rf radio
//
radio.begin();
radio.openWritingPipe(pipe);
//
// Dump the configuration of the rf unit for debugging
//
radio.printDetails();
//
// Set up buttons
//
/*to be used later
pinMode(ForwrdButton,INPUT );
pinMode(BackwrdButton,INPUT);
pinMode(transmit_enable,INPUT);
*/
pinMode(tx_led,OUTPUT);
digitalWrite(tx_led,LOW);
pinMode(StearRight,INPUT);
pinMode(StearLeft,INPUT);
digitalWrite(StearRight,HIGH);
digitalWrite(StearLeft,HIGH);
}
//
// Loop
//
void loop(void)
{
X_value = analogRead(analogInPinX);
data[0] = map(X_value, 0, 1023, 100, 200);
if(data[0]<100){
data[0]=100;
}
radio.write( data, buffer_size );
Serial.println(data[0]);
delay(10);
}