Transmiting PPM with Firmata to exmpl HK-T6A 2.4ghz trainer input ?

I am trying to build a combined system for controling my quadcopter first ..
i made a smal Visual basic tool that make it posible to see the quadcopter true WII mote , and some IRled for tracking.
.now it wil try to stay hover in the middle of the IR FOV of the Wii mote ,
it keeps the IR led in the middle , the WII mote uses y and x axes ,
example .. when IR led = > center then throttle wil decrease , and when IR led = < center then throttle wil increases
and when IR led == center then throttle wil hold position ,
butt here is the problem ,, !
i know firmata and arduino quite a bit ,, butt is there a way i can use Firmata ?
or is there a other aproach already used to send PPM example some software controled way to send data from joystick true Arduino connected to a example cheap hobbyking HK-6T6A 2.4ghz trainer input ?
maybe some body already has somthing i can take a look at , :astonished:

This might help:

yes thanks ... i found some simular stuff ,,, and yes this is the way to do it ,, butt now i have a other problem ,, how can i send like 6 channels data true serial to arduino ,,, i can make a buffer for fake analog inputs but inplace it uses my serial data ,,
i need to find the way to transmit this true visual basic serial to arduino ,, picking up serial commands transforming it to PPM
example ... i have channel 1=250 ch2=200 ch3=0 ch4=0 ch5=100 ch6=100 i wil have data stream like
250
200
0
0
100
100
6 times a digit for each channel how can i divide this for serial use ? :astonished:

You could send the numbers with delimiters, and start and stop marker.
Nick Gammon has made a great writeup here:

thnx ,, yes this is what i mean ,, did not know how to explain this ,,
butt yes this is it ,, thnx gone read this
i already searched some old Arduino scripts i used for switching different tings in vb true serial ,
but this aproach wil not be safe for a Rc quadcopter LOL !

thnx for reading and the advice
:smiley:

i have this at the moment :*
i onley need to combine the ppm in the script ,butt need to test and build some safety things in there when i press a emergency button it wil force back al inputs 2 zero ,
thanx for helping me out ,, i already have some major ideas with this comunication method :astonished:

// SERIAL INPUT R= ROLL T =TROTTLE P =PITCH A =AUX Y =YAW
// INPUT WIL BE LIKE THIS TRUE SERIAL ,,
// R100T200P200A0Y1024 AND

typedef enum { NONE, GOT_T, GOT_Y, GOT_P, GOT_R,GOT_A} states;

states state = NONE;

unsigned int currentValue;
int trot =0;
int yaw =0;
int pitch =0;
int roll =0;
int aux =0;

void setup ()
{
Serial.begin (115200);
state = NONE;
} // end of setup

void processT (const unsigned int value)
{
// do something with THROTTLE
Serial.print ("THROTTLE = ");
Serial.println (value);
trot =value;
} // end of processTHROTTLE

void processY (const unsigned int value)
{
// do something with YAW
Serial.print ("YAW =");
Serial.println (value);
yaw =value;
} // end of processYAW

void processP (const unsigned int value)
{
// do something with PITCH
Serial.print ("PITCH = ");
Serial.println (value);
pitch =value;
} // end of processPITCH

void processR (const unsigned int value)
{
// do something with ROLL
Serial.print ("ROLL = ");
Serial.println (value);
roll =value;
} // end of processROLL

void processA (const unsigned int value)
{
// do something with AUX
Serial.print ("AUX = ");
Serial.println (value);
aux =value;
} // end of processAUX
void handlePreviousState ()
{
switch (state)
{
case GOT_T:
processT (currentValue);
Serial.println ("PPM THROTTLE OUT");
Serial.println (trot);
break;
case GOT_Y:
processY (currentValue);
Serial.println ("PPM YAW OUT");
Serial.println (yaw);
break;
case GOT_P:
processP (currentValue);
Serial.println ("PPM PITCH OUT");
Serial.println (pitch);
break;
case GOT_R:
processR (currentValue);
Serial.println ("PPM ROLL OUT");
Serial.println (roll);
break;
case GOT_A:
processA (currentValue);
Serial.println ("PPM AUX OUT");
Serial.println (aux);
break;
} // end of switch

currentValue = 0;
} // end of handlePreviousState

void processIncomingByte (const byte c)
{
if (isdigit (c))
{
currentValue *= 10;
currentValue += c - '0';
} // end of digit
else
{

// The end of the number signals a state change
handlePreviousState ();

// set the new state, if we recognize it
switch (c)
{
case 'Y':
state = GOT_Y;
break;
case 'P':
state = GOT_P;
break;
case 'T':
state = GOT_T;
break;
case 'R':
state = GOT_R;
break;
case 'A':
state = GOT_A;
break;
default:
state = NONE;
break;
} // end of switch on incoming byte
} // end of not digit

} // end of processIncomingByte

void loop ()
{
if (Serial.available ())
processIncomingByte (Serial.read ());

// do other stuff in loop as required

} // end of loop

SERIALQUAD.ino (2.72 KB)

thanx for helping me out ,

You are wlcome.

i implemente the stuf in my vb program ,, butt the data needs to be more accurate ,,
i use a timer in vb to delay stuff for microseconds and using the map function to change the ppm to pwm output for testing servo response it works nice now
but neede to figure it out some more ,,
i use a bigg quadcopter for testing so when i start connecting stuff i need to hav like a 99% no failure rate .lol
and a mega emergency switch ,,

also think to use a other aproach like a cheap 433 mhz tx rx , transmiting data back and forward from a sonic height sensor and
let the program response to this ,, because the IR part is nice on the wii butt for small micro quad
but when i start using the big quad i need to have beter systems

now the folowing problem ,, i try to hack my frysky module inside the remote from hobbyking ,
i am still testing , but no response on the rx part ,, its binded
butt no response at all , need to check out some diferent scripts ,, lol :sleeping: