diff --git a/src/main.c b/src/main.c index 14da7c1..d2413a5 100644 --- a/src/main.c +++ b/src/main.c @@ -152,9 +152,13 @@ void MotorMoveTo(uint8_t target) { } // The delay ratio controlls the PWM waveforms. - _delay_ms((double)on_delay); + for(uint8_t i = 0; i < on_delay; i++){ + _delay_us(MOTOR_PULSE); + } MotorCoast(); - _delay_ms((double)off_delay); + for(uint8_t i = 0; i < off_delay; i++){ + _delay_us(MOTOR_PULSE); + } } return;