hi.. actually i'm using the futaba PCM1024 receiver...and i'm using pitch, roll, yaw, 3 channels at one time...
i'm directly feeding it to digital pins, 2,3,4... but i'm having problems.... the whole loop takes 28 msecs and when i time them using digitalwrite separately, i get 14 msecs for each channel pulsein function.. but when i time them 3 channels together.... roll gets 14 ms... but yaw n pitch gets only 7 ms.. so i'm thinking whether is it becos of lack of processing time from the atmel chip..
sorry for asking.. but how do i actually connect it to the same pin 8? that means i short the 3 channels together?
i'm in a rush actually... have a couple of wks to finish everyhting.. plus integration with the gyro signals and everything...
this is the same of the code i'm using
void loop()
{
digitalWrite(10,HIGH);
xtime = pulseIn(2,HIGH);
pin = servoRoll;
pulseWidthx = xtime;
update_servo(pin, pulseWidthx);
//digitalWrite(11,HIGH);
ytime = pulseIn(3,HIGH);
//digitalWrite(11,LOW);
pin = servoPitch;
pulseWidthy = ytime;
//digitalWrite(12,HIGH);
ztime = pulseIn(4,HIGH);
//digitalWrite(12,LOW);
pin = servoYaw;
pulseWidthz = ztime;
update_servo(pin, pulseWidthz);
digitalWrite(10,LOW);
}
void update_servo(int pin,long pulsewidth)
{
long pulse = 0;
int pin_num = 0;
pin_num = pin;
pulse = pulsewidth;
if(millis()- lastPulse >= RefreshTime)
{
digitalWrite(pin_num, HIGH);
delayMicroseconds(pulse);
digitalWrite(pin_num, LOW);
lastPulse = millis();
}
}