diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-29 09:34:54 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-29 09:34:54 +0200 |
commit | 4d446fb2c1d14142304971095ee60668ba9c6bc5 (patch) | |
tree | d5e5670f17a2d8a89748645b0739ef95dd6bf4f4 /robot/movement.c | |
parent | 0b50dfe730d87ff052ef08f0dd6df6071d50aef9 (diff) |
[WIP] last touches for second assessment
Diffstat (limited to 'robot/movement.c')
-rw-r--r-- | robot/movement.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/robot/movement.c b/robot/movement.c index e348410..b800464 100644 --- a/robot/movement.c +++ b/robot/movement.c @@ -1,41 +1,42 @@ #include "movement.h" #include "orangutan_shim.h" +#include "io.h" unsigned int g_w2_sensors[5] = {0}; // IR sensors on the bottom of the robot unsigned int g_w2_position = 0; // position on the black line // full rotation maze/charge void w2_maze_rotation_full() { - set_motors(0, 0); + w2_set_motors(0, 0); delay_ms(500); - set_motors(60, -60); + w2_set_motors(60, -60); delay_ms(540); - set_motors(0, 0); + w2_set_motors(0, 0); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); delay_ms(500); } // left turn maze/charge void w2_maze_rotation_half_left() { - set_motors(0, 0); - set_motors(50, 50); + w2_set_motors(0, 0); + w2_set_motors(50, 50); delay_ms(150); - set_motors(-30, 30); + w2_set_motors(-30, 30); delay_ms(600); - set_motors(0, 0); + w2_set_motors(0, 0); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); delay_ms(500); } // right turn maze/charge void w2_maze_rotation_half_right() { - set_motors(0, 0); - set_motors(50, 50); + w2_set_motors(0, 0); + w2_set_motors(50, 50); delay_ms(150); - set_motors(30, -30); + w2_set_motors(30, -30); delay_ms(600); - set_motors(0, 0); - set_motors(50, 50); + w2_set_motors(0, 0); + w2_set_motors(50, 50); delay_ms(150); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); delay_ms(500); @@ -43,24 +44,24 @@ void w2_maze_rotation_half_right() { // 180 turn in grid void w2_grid_rotation_full() { - set_motors(60, -60); + w2_set_motors(60, -60); delay_ms(540); - set_motors(10, 10); + w2_set_motors(10, 10); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); } // left turn in grid void w2_grid_rotation_half_left() { - set_motors(-30, 30); + w2_set_motors(-30, 30); delay_ms(600); - set_motors(10, 10); + w2_set_motors(10, 10); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); } // right turn in grid void w2_grid_rotation_half_right() { - set_motors(30, -30); + w2_set_motors(30, -30); delay_ms(600); - set_motors(10, 10); + w2_set_motors(10, 10); g_w2_position = read_line(g_w2_sensors, IR_EMITTERS_ON); } |