yup the box on the left hand side of the joystick is a 2.4ghz TX, there RX are only $8 or so each
http://www.hobbyking.com/hobbyking/store/__9770__Corona_2_4Ghz_DIY_Module_RX_DSSS_.htmlI gutted the joystick and plugged the pots straight into the arduino so you may have to do some work to get serial output to the arduino. the hard work of converting pots to ppm is done for you tho. you can view my reference code from Ian Johnston, the link is in the code.
Note that when you use serial with an arduino it loads up the cycle time so you may need to adjust for that
Sorry the code is a little messy but should be commented enough to get you through it
//Standalone Joystick 2.4ghz TX
//Hadley Boks-Wilson 2/07/2011
//ver 1.0
//Many thanks to Ian Johnston for the origonal code i started from
//http://www.ianjohnston.com
#include <EEPROM.h>
int god = 0;
int jesus = 0;
int buzz=0;
int bob=1;
int interval=500;
long previous = 0;
unsigned long current;
long previous1 = 0;
unsigned long current1;
byte AEL_TRIM = 127;
byte ELE_TRIM = 127;
byte RUD_TRIM = 127;
int AEL_TRIMI = 127;
int ELE_TRIMI = 127;
int RUD_TRIMI = 127;
int TRIMC = 0;
int TRIMc = 0;
int AI_Pin_AEL = 4; // Ana In - Aeleron potentiometer
int AI_Pin_ELE = 1; // Ana In - Elevator potentiometer
int AI_Pin_THR = 2; // Ana In - Throttle potentiometer
int AI_Pin_RUD = 3; // Ana In - Rudder potentiometer
int AI_Raw_AEL; // Ana In raw var - 0->1023
int AI_Raw_ELE; // Ana In raw var - 0->1023
int AI_Raw_THR; // Ana In raw var - 0->1023
int AI_Raw_RUD; // Ana In raw var - 0->1023
int AI_AEL; // Ana In var - 0->1023 compensated
int AI_ELE; // Ana In var - 0->1023 compensated
int AI_THR; // Ana In var - 0->1023 compensated
int AI_RUD; // Ana In var - 0->1023 compensated
int AI_TIpot; // Ana In var - 0->1023 compensated
int Aeleron_uS = 750; // Ana In Ch.0 uS var - Aeleron
int Elevator_uS = 750; // Ana In Ch.1 uS var - Elevator
int Throttle_uS = 750; // Ana In Ch.2 uS var - Throttle
int Rudder_uS = 750; // Ana In Ch.3 uS var - Rudder
int Fixed_uS = 300; // PPM frame fixed LOW phase
int pulseMin = 750; // pulse minimum width minus start in uS
int pulseMax = 1700; // pulse maximum width in uS
float DualrateMultAel = 0.9; // Dual rate mult
float DualrateMultEle = 0.9; // Dual rate mult
float DualrateMultThr = 0.9; // Dual rate mult
float DualrateMultRud = 0.9; // Dual rate mult
int DualrateAdjAel = 0; // Dual rate mid adjustment
int DualrateAdjEle = 0; // Dual rate mid adjustment
int DualrateAdjThr = 0; // Dual rate mid adjustment
int DualrateAdjRud = 0; // Dual rate mid adjustment
int outPinPPM = 10; // digital pin 11
ISR(TIMER1_COMPA_vect) {
ppmoutput(); // Jump to ppmoutput subroutine
}
void setup() {
//Serial.begin(9600) ; // Test
pinMode(2,INPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
pinMode(5,INPUT);
pinMode(6,INPUT);
pinMode(7,INPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
pinMode(outPinPPM, OUTPUT); // sets the digital pin as output
// Setup timer
TCCR1A = B00110001; // Compare register B used in mode '3'
TCCR1B = B00010010; // WGM13 and CS11 set to 1
TCCR1C = B00000000; // All set to 0
TIMSK1 = B00000010; // Interrupt on compare B
TIFR1 = B00000010; // Interrupt on compare B
OCR1A = 22000; // 22mS PPM output refresh
OCR1B = 1000;
AEL_TRIM = EEPROM.read(1);
ELE_TRIM = EEPROM.read(2);
RUD_TRIM = EEPROM.read(3);
digitalWrite(9, HIGH); // Turn on buzzer
delay (10);
digitalWrite(9, LOW); // Turn off buzzer
delay (100);
digitalWrite(9, HIGH); // Turn on buzzer
delay (10);
digitalWrite(9, LOW); // Turn off buzzer
delay (100);
digitalWrite(9, HIGH); // Turn on buzzer
delay (10);
digitalWrite(9, LOW); // Turn off buzzer*/
}
void ppmoutput() { // PPM output sub
// test pulse - used to trigger scope
// digitalWrite(outPinTEST, LOW);
// delayMicroseconds(100); // Hold
// digitalWrite(outPinTEST, HIGH);
// Channel 1 - Aeleron
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Aeleron_uS); // Hold for Aeleron_uS microseconds
// Channel 2 - Elevator
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Elevator_uS); // Hold for Elevator_uS microseconds
// Channel 3 - Throttle
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Throttle_uS); // Hold for Throttle_uS microseconds
// Channel 4 - Rudder
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(Rudder_uS); // Hold for Rudder_uS microseconds
// Synchro pulse
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH); // Start Synchro pulse
}
void loop() { // Main loop
// Read analogue ports
AI_Raw_AEL = analogRead(AI_Pin_AEL);
AI_Raw_ELE = analogRead(AI_Pin_ELE);
AI_Raw_THR = analogRead(AI_Pin_THR);
AI_Raw_RUD = analogRead(AI_Pin_RUD);
// Compensate for discrepancy in pot inputs including centering offset.
// Also use this to invert inputs if necessary (swap x1 & y1)
// y=mx+c, x to y scales to x1 to y1
AI_AEL = map(AI_Raw_AEL, 0, 1023, 1200, 0) - 75 -(127-AEL_TRIM); // Invert Aeleron pot and slight centre offset
AI_ELE = map(AI_Raw_ELE, 0, 1023, 1200, 0) - 75 -(127-ELE_TRIM); // Invert Elevator pot and slight centre offset
AI_THR = map(AI_Raw_THR, 0, 1023, 0, 1023) - (127-RUD_TRIM); // Throttle
AI_RUD = map(AI_Raw_RUD, 0, 1023, 1023, 0) + 0; // Rudder
god=AEL_TRIM+ELE_TRIM+RUD_TRIM;
// Map analogue inputs to PPM rates for each of the channels
Aeleron_uS = (AI_AEL * 1.1) + pulseMin - 100;
Elevator_uS = (AI_ELE * 1.1) + pulseMin - 100;
Throttle_uS = (AI_THR * 1.1) + pulseMin - 100;
Rudder_uS = (AI_RUD * 1.1) + pulseMin - 100;
// Check limits
if (Aeleron_uS <= 750) Aeleron_uS = 750; // Min
if (Aeleron_uS >= 1700) Aeleron_uS = 1700; // Max
if (Elevator_uS <= 750) Elevator_uS = 750; // Min
if (Elevator_uS >= 1700) Elevator_uS = 1700; // Max
if (Throttle_uS <= 750) Throttle_uS = 750; // Min
if (Throttle_uS >= 1700) Throttle_uS = 1700; // Max
if (Rudder_uS <= 750) Rudder_uS = 750; // Min
if (Rudder_uS >= 1700) Rudder_uS = 1700; // Max
if (AEL_TRIM <= 1)AEL_TRIM =1;
if (AEL_TRIM >= 254)AEL_TRIM =254;
if (ELE_TRIM <= 1)ELE_TRIM =1;
if (ELE_TRIM >= 254)ELE_TRIM =254;
if (RUD_TRIM <= 1)RUD_TRIM =1;
if (RUD_TRIM >= 254)RUD_TRIM =254;
TRIMC=AEL_TRIM+ELE_TRIM+RUD_TRIM;
AEL_TRIMI = (int)AEL_TRIM;
ELE_TRIMI = (int)ELE_TRIM;
RUD_TRIMI = (int)RUD_TRIM;
if (digitalRead(7)==LOW&&jesus==0){
AEL_TRIM++;
interval=200;}
if (digitalRead(3)==LOW&&jesus==0){
ELE_TRIM++;
interval=200;}
if (digitalRead(2)==LOW&&jesus==0){
RUD_TRIM++;
interval=200;}
if (digitalRead(5)==LOW&&jesus==0){
RUD_TRIM--;
interval=200;}
if (digitalRead(6)==LOW&&jesus==0){
ELE_TRIM--;
interval=200;}
if (digitalRead(4)==LOW&&jesus==0){
AEL_TRIM--;
interval=200;}
jesus=god-(AEL_TRIM+ELE_TRIM+RUD_TRIM);
/*Serial.print(Aeleron_uS);
Serial.print(" Aeleron_uS "); //for debug
Serial.print(Elevator_uS);
Serial.print(" Elevator_uS ");
Serial.print(Throttle_uS);
Serial.print(" Throttle_uS ");
Serial.print(Rudder_uS);
Serial.println(" Rudder_uS ");
Serial.print(jesus);
Serial.print(" jesus ");
Serial.print(buzz);
Serial.print(" buzz ");
Serial.print(AEL_TRIMI-127);
Serial.print(" Alerion trim "); //for debug
Serial.print(ELE_TRIMI-127);
Serial.print(" Elevater trim ");
Serial.print(RUD_TRIMI-127);
Serial.print(" Rudder trim ");
Serial.print(AEL_TRIMc);
Serial.print(" Alerion "); //for debug
Serial.print(ELE_TRIMc);
Serial.print(" Elevater ");
Serial.print(RUD_TRIMc);
Serial.print(" Rudder ");
Serial.println(millis()); */
if(jesus != 0){
buzz=1;
}
if(buzz == 1){
digitalWrite(9, HIGH);
current=millis();
if(current-previous >interval){
previous = current;
buzz=0;
digitalWrite(9, LOW);
}
}
current1=millis();
if(current1-previous1 >10000){
previous1 = current1;
if(TRIMC!=TRIMc){
//Serial.println(" save ");
EEPROM.write(1,AEL_TRIM);
EEPROM.write(2,ELE_TRIM);
EEPROM.write(3,RUD_TRIM);
TRIMc=TRIMC;
}
}
}