diff --git a/Code Telecommande/src/inputs.c b/Code Telecommande/src/inputs.c index 4832bf0..28c1d0c 100644 --- a/Code Telecommande/src/inputs.c +++ b/Code Telecommande/src/inputs.c @@ -59,4 +59,7 @@ void get_inputs(void) if(controller.inputs_buffer.buttons_states[BUTTON_R]) controller.inputs_buffer.robot_angle -= controller.delta_time_ms / 1000.0f * ANGLE_PER_SECOND; + + if(controller.inputs_buffer.robot_angle > 180) controller.inputs_buffer.robot_angle -= 360; + if(controller.inputs_buffer.robot_angle < -180) controller.inputs_buffer.robot_angle += 360; }