Created
June 18, 2012 17:51
-
-
Save jonmarkgo/2949682 to your computer and use it in GitHub Desktop.
Movement functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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