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