feat: 增加距离控制

This commit is contained in:
bmy
2024-05-10 12:17:54 +08:00
parent 1c83cbc70a
commit 82e5f25e3a
4 changed files with 132 additions and 42 deletions

View File

@@ -237,6 +237,7 @@ void TMR4_GLOBAL_IRQHandler(void)
/* add user code begin TMR4_GLOBAL_IRQ 0 */
if (SET == tmr_interrupt_flag_get(TMR4, TMR_OVF_FLAG)) {
by_motion_run();
by_motion_tmr_handle();
tmr_flag_clear(TMR4, TMR_OVF_FLAG);
}
/* add user code end TMR4_GLOBAL_IRQ 0 */

View File

@@ -129,7 +129,7 @@ int main(void)
/* add user code begin 3 */
// lwprintf("pwm value: %f\r\n", param_m1.out_pwm);
// lwprintf("mot speed: %f\r\n", param_m1.real_speed);
lwprintf("%f,%f,%f\r\n", param_m1.real_speed, param_m1.target_speed, param_m1.out_pwm);
// lwprintf("%f,%f,%f\r\n", param_m1.real_speed, param_m1.target_speed, param_m1.out_pwm);
/* add user code end 3 */
}
}