From 92a43e07b10903d5f1a572ebdf9a40571b75e73d Mon Sep 17 00:00:00 2001 From: lonkaars Date: Wed, 8 Jun 2022 14:51:01 +0200 Subject: worky --- robot/mode_chrg.c | 8 ++++++-- robot/mode_grid.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/robot/mode_chrg.c b/robot/mode_chrg.c index a871b69..64497e2 100644 --- a/robot/mode_chrg.c +++ b/robot/mode_chrg.c @@ -30,14 +30,18 @@ void w2_home() { void w2_charge_cross_walk() { + if (g_w2_transition == 0) { + set_motors(-30, 30); + delay(50); + } while (g_w2_sensors[0] < 100 && g_w2_sensors[1] < 100 && g_w2_sensors[2] < 100 && g_w2_sensors[3] < 100 && g_w2_sensors[4] < 100) { set_motors(15, 15); - delay(500); + delay(550); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); if (g_w2_sensors[2] > 100 || g_w2_sensors[3] > 100 || g_w2_sensors[1] > 100) { set_motors(0, 0); - clear(); + // clear(); print("WALK"); g_w2_transition++; if (g_w2_transition == 3) { //TODO: document g_w2_transition diff --git a/robot/mode_grid.c b/robot/mode_grid.c index c6ebef3..e864db7 100644 --- a/robot/mode_grid.c +++ b/robot/mode_grid.c @@ -35,7 +35,7 @@ void w2_crosswalk_stroll() { while (g_w2_sensors[0] < 100 && g_w2_sensors[1] < 100 && g_w2_sensors[2] < 100 && g_w2_sensors[3] < 100 && g_w2_sensors[4] < 100) { set_motors(15, 15); - delay(300); + delay(290); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); if (g_w2_sensors[2] > 100 || g_w2_sensors[3] > 100 || g_w2_sensors[1] > 100) { set_motors(0, 0); -- cgit v1.2.3