Transfer fullMotorTest function to motors.ino

This commit is contained in:
Oleg Kalachev
2023-12-03 20:43:55 +03:00
parent 80ecba8337
commit 94b483cda6
4 changed files with 14 additions and 69 deletions

View File

@@ -61,3 +61,15 @@ void sendMotors()
ledcWrite(2, pwmToDutyCycle(getPWM(motors[2], 2)));
ledcWrite(3, pwmToDutyCycle(getPWM(motors[3], 3)));
}
void fullMotorTest(int n, bool reverse)
{
printf("Full test for motor %d\n", n);
for (int pwm = PWM_NEUTRAL; pwm <= 2300 && pwm >= 700; pwm += reverse ? -100 : 100) {
printf("Motor %d: %d\n", n, pwm);
ledcWrite(n, pwmToDutyCycle(pwm));
delay(3000);
}
printf("Motor %d: %d\n", n, PWM_NEUTRAL);
ledcWrite(n, pwmToDutyCycle(PWM_NEUTRAL));
}