/*
http://www.mediafire.com/download/cwgsx47ir8ebcut/nRF24L01p.rar
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
const uint64_t pipeOut = 0xE8E8F0F0E1LL;
RF24 radio(9, 10);
// The sizeof this struct should not exceed 32 bytes
struct MyData {
byte SpeedL;
byte SpeedR;
};
MyData data;
void resetData()
{
data.SpeedL = 0;
data.SpeedR = 0;
}
void setup()
{
radio.begin();
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipeOut);
resetData();
}
/**************************************************/
void loop()
{
// The calibration numbers used here should be measured
// for your joysticks using the TestJoysticks sketch.
data.SpeedL = 111;
data.SpeedR = 222;
radio.write(&data, sizeof(MyData));
}