Pages: [1]   Go Down
Author Topic: Help: Arduino with Python to RC PPM Trainer  (Read 534 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 134
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!




Keith
« Last Edit: February 22, 2012, 09:16:12 am by Keith Brown » Logged

United States
Offline Offline
Newbie
*
Karma: 2
Posts: 49
Yes. Thats my donkey
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
   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

rcarduino.blogspot.com
« Last Edit: March 23, 2012, 04:24:43 am by DuaneB » Logged


Pages: [1]   Go Up
Jump to: