Hi, I am playing with a self stabilizing radiocontrolled platform, and came across this great little snippet in this forum:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1290626864It works great bu itself, but i had already built the controlling logic which reads accelerometer input and servo output, wich worked great until i added this code to my sketch. Actually i removed all subroutines *doing* anything in the code and still with only the initialization remaining in the sketch the sloppyness ( really slow servo response - more than 5 sec to complete a servo turn)
Here is the initialization i am using:
//Create variables for 6 channels
int RXCH[6];
volatile int RXSG[6];
int RXOK[6];
int PWMSG[6];
void setup() {
for (int thisReading = 0; thisReading < numReadings; thisReading++)
readingsx[thisReading] = 0;
//Assign PPM input pins. The receiver output pins are conected as below to non-PWM Digital connectors:
//RXCH[1] = 4; //Throttle
//RXCH[2] = 6; //Aile / Yaw
//RXCH[3] = 5; //Elev. / Pitch
//RXCH[4] = 2; //Rudd. / Roll
//RXCH[5] = 7; //Gear
//RXCH[6] = 8; //Aux / Flt Mode
//for (int i = 1; i < 7; i++){
// pinMode(RXCH[i], INPUT);
// }
Now that i have torn most of my hair off, do anyone have a clue what happens ?
Sorry for being a newb ... :-/
Vidar