Implement SERVO_DELAY as array
This modify give SERVO_DELAY x servo basis
This commit is contained in:
committed by
Scott Lahteine
parent
96ae53cf41
commit
e9c72978c7
@@ -308,9 +308,11 @@ int Servo::readMicroseconds() {
|
||||
bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
|
||||
|
||||
void Servo::move(int value) {
|
||||
constexpr uint16_t servo_delay[] = SERVO_DELAY;
|
||||
static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long.");
|
||||
if (this->attach(0) >= 0) {
|
||||
this->write(value);
|
||||
delay(SERVO_DELAY);
|
||||
delay(servo_delay[this->servoIndex]);
|
||||
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
|
||||
this->detach();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user