Add independent servos option

pull/1/head
Mathis et Yohan 2021-12-01 18:58:16 +01:00
rodzic 489171ffad
commit 4653f7cbe6
1 zmienionych plików z 39 dodań i 20 usunięć

Wyświetl plik

@ -14,7 +14,7 @@
#define i_want_to_fly false // Simulated servo movement to test the servo movement :))
#define buzzer_turn true // Buzzer sounds as function of the turn command
#define no_init false // Skip init, for testing only purposes
#define pitch true // RC control with pitch and roll, or only roll
#define rc_mode 2 // 0 = only roll, 1 = pitch and roll mixed, 2 = pitch and roll separated
#define autopilot_mode 1 // Control linear or with "hands up"
#define drop false // R2Home's version, drop or motorised
#define record_home false // only record autopilot
@ -971,10 +971,14 @@ void applycmd() {
case 1:
case 6:
if (failSafe == false) {
if (pitch == false) {
servo_left = roll_man; servo_right = 3000-roll_man;
}
else {
switch (rc_mode) {
case 0:
servo_left = roll_man;
servo_right = 3000-roll_man;
break;
case 1:
servo_left = roll_man;
servo_right = 3000-roll_man;
@ -983,16 +987,25 @@ void applycmd() {
servo_left = constrain(servo_left, servo_man_min, servo_man_max);
servo_right = constrain(servo_left, servo_man_min, servo_man_max);
break;
case 2:
servo_left = roll_man;
servo_right = pitch_man;
break;
}
}
else { servo_left = 1500; servo_right = 1500; }
break;
case 8:
if (pitch == false) {
servo_left = roll_man; servo_right = 3000-roll_man;
}
else {
switch (rc_mode) {
case 0:
servo_left = roll_man;
servo_right = 3000-roll_man;
break;
case 1:
servo_left = roll_man;
servo_right = 3000-roll_man;
@ -1001,6 +1014,12 @@ void applycmd() {
servo_left = constrain(servo_left, servo_man_min, servo_man_max);
servo_right = constrain(servo_left, servo_man_min, servo_man_max);
break;
case 2:
servo_left = roll_man;
servo_right = pitch_man;
break;
}
break;