M282 - Detach Servo (#22760)

This commit is contained in:
Dakkaron
2021-09-15 02:00:48 +02:00
committed by GitHub
parent c2e4b1626f
commit 21e8f99500
11 changed files with 76 additions and 14 deletions

View File

@@ -39,19 +39,19 @@ HAL_SERVO_LIB servo[NUM_SERVOS];
void servo_init() {
#if NUM_SERVOS >= 1 && HAS_SERVO_0
servo[0].attach(SERVO0_PIN);
servo[0].detach(); // Just set up the pin. We don't have a position yet. Don't move to a random position.
DETACH_SERVO(0); // Just set up the pin. We don't have a position yet. Don't move to a random position.
#endif
#if NUM_SERVOS >= 2 && HAS_SERVO_1
servo[1].attach(SERVO1_PIN);
servo[1].detach();
DETACH_SERVO(1);
#endif
#if NUM_SERVOS >= 3 && HAS_SERVO_2
servo[2].attach(SERVO2_PIN);
servo[2].detach();
DETACH_SERVO(2);
#endif
#if NUM_SERVOS >= 4 && HAS_SERVO_3
servo[3].attach(SERVO3_PIN);
servo[3].detach();
DETACH_SERVO(3);
#endif
}