Go Down

Topic: Help: Arduino with Python to RC PPM Trainer (Read 1 time) previous topic - next topic

Keith Brown

Feb 22, 2012, 03:06 pm Last Edit: Feb 22, 2012, 03:16 pm by Keith Brown Reason: 1
Hey Guys!

I've been fiddling with some code that I've found online, the python serial and python game classes.
Using another bit of code (i'll try to get some reference links later) I was able to get a few servos controlled by a joystick on the pc. The arduino waits for the serial value to change and sends info to digital pins 2-5.

Scouring the internet i found a gentleman that used an accelerometer to control channels through the trainer port of his rc transmitter, but he was using the analog pins and assigning each pin to an array and then to an array of pulses that he sent to pin 12 on the arduino.

I want to merge the two scripts, and instead of going directly to the servos from digital pins 2-5 take those values and convert them to a pulse signal i can send to the transmitter for an rc flight.

I know a bit about programming ( I work as a flash application developer).

After all that my question is:
How can I manipulate the serial input of the arduino, which is listening for a serial change from the joystick, into pulses I can send through a trainer cord to my RC transmitter?

In the code i researched, these gentlemen use a series of of high and low states in conjuction with a delay from a timer class. They send all 4- channels to the one pin in a matter of about 20ms or so. I understand the tech from reading their code, but im having a hard time accomplishing this.

The python code uses a servo class that sends information to the servo using a method called move(). it takes 2 parameters, the servo number (also the digital pin num) and the position in degrees. ex Servo.move(3,150), where Servo is the Class or the py file.

Can anyone help me figure this out?

What do you need from me for a better analysis?

So, I want to take whatever the arduino is sending to the 4 individual pins and send the information to a single pin with the pulse conversion stated above...

Thank you for your time!
Here is a video of the code i got working on my pc. Thank you!




If Arduino augmented RC flight is your goal have you seen www.diydrones.com/notes/ArduPilot ? Arduino + RC Plane + GPS = DIY Drone! Looks like they may have at least some of your interests in common.


Mar 23, 2012, 10:22 am Last Edit: Mar 23, 2012, 10:24 am by DuaneB Reason: 1
   Why not keep the code you have and simply put it through an OR gate ?could be a very cheap and easy solution.

   The inputs to the OR Gate will be your existing servo pins, the output will go to the transmitter. The function of an OR Gate is to make the output high if any of the inputs are high, this seems to be what you are looking for ?

Duane B

Read this
then watch this


Go Up