diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-24 12:22:49 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-24 12:22:49 +0200 |
commit | c47518a99d8c8a49a8a97100bdff5b06cfa125ae (patch) | |
tree | e59f79b106f31a21ae54991af682ba2cf80ebd47 /robot/mode_grid.c | |
parent | 40f6164ba6187a0160af9fe200bbd1d729e8c03b (diff) |
mode_chrg & mode_maze respect g_w2_target_area
Diffstat (limited to 'robot/mode_grid.c')
-rw-r--r-- | robot/mode_grid.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/robot/mode_grid.c b/robot/mode_grid.c index 7e6db49..cfecae5 100644 --- a/robot/mode_grid.c +++ b/robot/mode_grid.c @@ -1,8 +1,13 @@ #include "mode_grid.h" +#include "hypervisor.h" #include "modes.h" #include "movement.h" #include "orangutan_shim.h" +/** + * TODO: mode_grid g_w2_target_area laten volgen + */ + int g_w2_order_number; int g_w2_maze_status = 0; @@ -30,7 +35,8 @@ void w2_crosswalk_stroll() { set_motors(15, 15); 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) { + if ((g_w2_sensors[2] > 100 || g_w2_sensors[3] > 100 || g_w2_sensors[1] > 100) && + (g_w2_target_area != W2_AREA_MAZE)) { set_motors(0, 0); g_w2_transition++; if (g_w2_transition == 3) { |