mirror of https://github.com/ArduPilot/ardupilot
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1320 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
34ed0b8183
commit
7fbfb4498d
|
@ -75,19 +75,23 @@ void setup()
|
||||||
|
|
||||||
// set type of output, symmetrical angles or a number range;
|
// set type of output, symmetrical angles or a number range;
|
||||||
rc_1.set_angle(4500);
|
rc_1.set_angle(4500);
|
||||||
|
rc_1.dead_zone = 50;
|
||||||
rc_2.set_angle(4500);
|
rc_2.set_angle(4500);
|
||||||
|
rc_2.dead_zone = 50;
|
||||||
rc_3.set_range(0,1000);
|
rc_3.set_range(0,1000);
|
||||||
rc_4.set_angle(3000);
|
rc_3.dead_zone = 20;
|
||||||
|
rc_3.scale_output = .8;
|
||||||
|
rc_4.set_angle(6000);
|
||||||
|
rc_4.dead_zone = 500;
|
||||||
rc_5.set_range(0,1000);
|
rc_5.set_range(0,1000);
|
||||||
rc_6.set_range(0,1000);
|
rc_5.set_filter(false);
|
||||||
|
rc_6.set_range(200,800);
|
||||||
rc_7.set_range(0,1000);
|
rc_7.set_range(0,1000);
|
||||||
rc_8.set_range(0,1000);
|
rc_8.set_range(0,1000);
|
||||||
|
|
||||||
// set midpoint value
|
for (byte i = 0; i < 30; i++){
|
||||||
rc_1.set_pwm(APM_RC.InputCh(CH_1));
|
read_radio();
|
||||||
rc_2.set_pwm(APM_RC.InputCh(CH_2));
|
}
|
||||||
rc_4.set_pwm(APM_RC.InputCh(CH_4));
|
|
||||||
|
|
||||||
rc_1.trim();
|
rc_1.trim();
|
||||||
rc_2.trim();
|
rc_2.trim();
|
||||||
rc_4.trim();
|
rc_4.trim();
|
||||||
|
@ -98,6 +102,13 @@ void setup()
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
delay(20);
|
delay(20);
|
||||||
|
read_radio();
|
||||||
|
print_pwm();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void read_radio()
|
||||||
|
{
|
||||||
rc_1.set_pwm(APM_RC.InputCh(CH_1));
|
rc_1.set_pwm(APM_RC.InputCh(CH_1));
|
||||||
rc_2.set_pwm(APM_RC.InputCh(CH_2));
|
rc_2.set_pwm(APM_RC.InputCh(CH_2));
|
||||||
rc_3.set_pwm(APM_RC.InputCh(CH_3));
|
rc_3.set_pwm(APM_RC.InputCh(CH_3));
|
||||||
|
@ -106,8 +117,7 @@ void loop()
|
||||||
rc_6.set_pwm(APM_RC.InputCh(CH_6));
|
rc_6.set_pwm(APM_RC.InputCh(CH_6));
|
||||||
rc_7.set_pwm(APM_RC.InputCh(CH_7));
|
rc_7.set_pwm(APM_RC.InputCh(CH_7));
|
||||||
rc_8.set_pwm(APM_RC.InputCh(CH_8));
|
rc_8.set_pwm(APM_RC.InputCh(CH_8));
|
||||||
|
//Serial.printf_P(PSTR("OUT 1: %d\t2: %d\t3: %d\t4: %d \n"), rc_1.control_in, rc_2.control_in, rc_3.control_in, rc_4.control_in);
|
||||||
print_pwm();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_pwm()
|
void print_pwm()
|
||||||
|
|
Loading…
Reference in New Issue