Skip to content
Snippets Groups Projects
Unverified Commit 2cca1837 authored by Marco Aceti's avatar Marco Aceti Committed by Daniele Ceribelli
Browse files

Check north/south limits in executeMovement

parent 13ac5e13
Branches
Tags
No related merge requests found
......@@ -89,12 +89,12 @@ void executeMovement() {
const int vertical = data.north - data.south;
const int horizontal = data.east - data.west;
if (vertical > EPSILON) {
if (vertical > EPSILON && !NORTH_LIMIT_REACHED) {
motorMove(Direction::North, MOTOR_MOVEMENT_TIME);
#ifdef DEBUG
Serial.println("Moving north.");
#endif
} else if (vertical < -EPSILON) {
} else if (vertical < -EPSILON && !SOUTH_LIMIT_REACHED) {
motorMove(Direction::South, MOTOR_MOVEMENT_TIME);
#ifdef DEBUG
Serial.println("Moving south.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment