Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created June 18, 2012 17:51
Show Gist options
  • Save jonmarkgo/2949682 to your computer and use it in GitHub Desktop.
Save jonmarkgo/2949682 to your computer and use it in GitHub Desktop.
Movement functions
void stopMovement() {
rightservo.write(rightStopPos);
leftservo.write(leftStopPos);
}
void turnLeft() {
rightservo.write(180);
leftservo.write(180);
}
void turnRight() {
rightservo.write(0);
leftservo.write(0);
}
//motors are reversed since they're on opposite sides of the bot, opposite directions make it go straight!
void moveForward() {
rightservo.write(180);
leftservo.write(0);
}
void moveBackward() {
rightservo.write(0);
leftservo.write(180);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment