summaryrefslogtreecommitdiff
path: root/robot/movement.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-08 15:47:43 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-08 15:47:43 +0200
commit31fe6a4c0b2a00f7b7f81055fe5dfb3fc37326be (patch)
tree5cf8bf0c346f14c779cac314f80169b1122aee72 /robot/movement.c
parentf062bfb8e88c0e62edd830bfbcaee14f1688c510 (diff)
parent74e7db1f43d5511da291050f2ddd5d701bb04258 (diff)
merge pull request from @nonailla
Diffstat (limited to 'robot/movement.c')
-rw-r--r--robot/movement.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/robot/movement.c b/robot/movement.c
index 61a944b..37d66d5 100644
--- a/robot/movement.c
+++ b/robot/movement.c
@@ -1,9 +1,11 @@
#include "movement.h"
#include "orangutan_shim.h"
-unsigned int g_w2_sensors[5] = {0};
-unsigned int g_w2_position = 0;
+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);
delay_ms(500);
@@ -14,6 +16,7 @@ void w2_maze_rotation_full() {
delay_ms(500);
}
+//left turn maze/charge
void w2_maze_rotation_half_left() {
set_motors(0, 0);
set_motors(50, 50);
@@ -24,6 +27,8 @@ void w2_maze_rotation_half_left() {
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);
@@ -37,6 +42,7 @@ void w2_maze_rotation_half_right() {
delay_ms(500);
}
+//180 turn in grid
void w2_grid_rotation_full() {
set_motors(60, -60);
delay_ms(540);
@@ -44,6 +50,7 @@ void w2_grid_rotation_full() {
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);
delay_ms(600);
@@ -51,6 +58,7 @@ void w2_grid_rotation_half_left() {
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);
delay_ms(600);