diff --git a/libraries/CurioDuinoNav/CurioDuinoNav.cpp b/libraries/CurioDuinoNav/CurioDuinoNav.cpp index 99b9452..36e930f 100644 --- a/libraries/CurioDuinoNav/CurioDuinoNav.cpp +++ b/libraries/CurioDuinoNav/CurioDuinoNav.cpp @@ -18,16 +18,16 @@ void CurioDuinoNav::begin() forwardSpeed = 0; } -void CurioDuinoNav::turnLeft() +void CurioDuinoNav::turnLeft(int turnDuration) { motors.setSpeeds(-TURN_SPEED, TURN_SPEED); - delay(TURN_DURATION); + delay(turnDuration); } -void CurioDuinoNav::turnRight() +void CurioDuinoNav::turnRight(int turnDuration) { motors.setSpeeds(TURN_SPEED, -TURN_SPEED); - delay(TURN_DURATION); + delay(turnDuration); } void CurioDuinoNav::goForward() diff --git a/libraries/CurioDuinoNav/CurioDuinoNav.h b/libraries/CurioDuinoNav/CurioDuinoNav.h index 20c6c31..828a35a 100644 --- a/libraries/CurioDuinoNav/CurioDuinoNav.h +++ b/libraries/CurioDuinoNav/CurioDuinoNav.h @@ -23,7 +23,8 @@ class ZumoMotors; // Duration of movements #define REVERSE_DURATION 750 // ms -#define TURN_DURATION 400 +#define EDGE_TURN_DURATION 440 +#define OBSTACLE_TURN_DURATION 340 class CurioDuinoNav { @@ -36,8 +37,8 @@ class CurioDuinoNav // because Arduino constructors // are not advised. void begin(); - void turnRight(); - void turnLeft(); + void turnRight(int turnDuration); + void turnLeft(int turnDuration); void goForward(); void goReverse(); void stopMoving();