aboutsummaryrefslogtreecommitdiff
path: root/robot/mode_dirc.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-07 23:46:48 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-07 23:46:48 +0200
commit0d3c52e49dc34344f335fd6d7b214592723cbc93 (patch)
tree36c8b974556a5ee3c955549131ac3858208d373b /robot/mode_dirc.c
parentc88c7c7c6e6c687c3d8170cb07a467aa3c4d7f48 (diff)
implemented obstacle detection
Diffstat (limited to 'robot/mode_dirc.c')
-rw-r--r--robot/mode_dirc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/robot/mode_dirc.c b/robot/mode_dirc.c
index 7021721..429d1e1 100644
--- a/robot/mode_dirc.c
+++ b/robot/mode_dirc.c
@@ -10,16 +10,7 @@
int16_t g_w2_mode_dirc_motor_l = 0;
int16_t g_w2_mode_dirc_motor_r = 0;
-uint8_t g_w2_mode_dirc_power = 100;
void w2_mode_dirc() {
- if (g_w2_connected == 1)
- g_w2_mode_dirc_power = 100;
- else
- g_w2_mode_dirc_power = W2_MAX(0, g_w2_mode_dirc_power - 1);
-
- if (g_w2_mode_dirc_power == 0) w2_modes_call(W2_M_HALT);
-
- set_motors(g_w2_mode_dirc_motor_l * g_w2_mode_dirc_power / 100,
- g_w2_mode_dirc_motor_r * g_w2_mode_dirc_power / 100);
+ set_motors(g_w2_mode_dirc_motor_l, g_w2_mode_dirc_motor_r);
}