Skip to content

Commit

Permalink
Edited constants and required turn method to accept input for turn du…
Browse files Browse the repository at this point in the history
…rations. v1.0.1
  • Loading branch information
davidskeck committed Apr 24, 2014
1 parent edd696b commit f624cbf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions libraries/CurioDuinoNav/CurioDuinoNav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions libraries/CurioDuinoNav/CurioDuinoNav.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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();
Expand Down

0 comments on commit f624cbf

Please sign in to comment.