3pi Arduino and RC

So I have a minor problem, I have the 328p 3pi and have been playing around with it the last few weeks and now I wish to get it running on some RC. There isn’t much I could find for hooking it up to an airplane tx/rx specifically the turnugy tg7 9x (not the 9xr). I have been playing around and have this so far:

[code]#include <OrangutanAnalog.h>
#include <OrangutanLCD.h>

int bat = OrangutanAnalog::readBatteryMillivolts();
int ch1 = 0;
int ch3 = 0;

int throttle = 0;
int steer = 19;

void setup() {

pinMode(19, INPUT); //PC5 analog input 5
pinMode(0, INPUT); //PD0 digital pin 0
Serial.begin(9600);

}

void loop() {

ch1 = pulseIn(throttle, HIGH, 25000);
ch3 = pulseIn(steer, HIGH, 25000);
OrangutanLCD::gotoXY(0,0);
OrangutanLCD::print(ch3);
OrangutanLCD::gotoXY(0,1);        
OrangutanLCD::print(ch1);

}[/code]

When I turn on the robot and the tx I get a reading anywhere from 1000 to 1800 for the pulses on channel 1 or the throttle input from the transmitter left stick. The other channel which is the aileron and elevator stick has nothing coming through. I understand it could be the way I have something wired but I’m wondering why I can’t read any inputs from it. It is a stick that self centers.I’ve included an image of the current wiring just in case I’ve messed up something there too. The part that really gets me lost is I have channel 1 of the rx wired to PC5 and channel 3 which is the throttle of the transmitter wired to PD0, it feels backwards but I can’t be sure. Take note there is no jumper on the PC5 and I wasn’t sure from the documentation if I had to leave it off or not to allow the use of PC5.

I appreciate any tips on wiring or coding because it has been about 2 years or so since the last time I played with this little bot.

Thanks,
Motodale

Hello, Motodale.

From the picture, it looks like you have 2 wires from the right module connected to GND and PD0 and 2 wires from the left module connected to PC5 and VBST. According to Turnigy, the input voltage range of the receiver is 4.5V to 6.5V. Are you intentionally connecting your receiver to the 9.25V rail (VBOOST)? Could you provide a wiring diagram of your setup? Could you also try swapping the two signal wires you have attached to PD0 and PC5 and see if the problem stays with the pin or follows the signal wire?

- Jeremy

Hi Jeremy,

So I didn’t realize I had my on pin on the VBST, that part was is fixed now. I also have the pins to to the right channels now. Channel 3 is the throttle control on the turnigy RX and that is now reflected properly in the pin by connecting the data cable to PD0. I updated my code to just switch the channels to also reflect the controller sticks. I tested the pins like you said by pulling one out and seeing if anything happened. When PD0 was in i was able to receive signal just fine. When PC5 was the only pin plugged in I had nothing happening, both sticks. Here’s where it gets good: changed out the servo wires, nothing. finally wiggled my small white wires around that are connected to the header. It worked. Sometimes it’s good to be told to check wires. So thanks for reminding me. Is there a proper place to put a completed or in progress project for those interested?

Thanks again,
Motodale

I am glad you got the servos working with your 3pi. If you would like to, you can post about your project in the Share Your Projects section of our forum.

- Jeremy