Last active
December 15, 2016 14:31
-
-
Save LarsBergqvist/c8a820af24ae0af1839c1c002dfd80c3 to your computer and use it in GitHub Desktop.
servo_wheels.py
This file contains 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
def stop(): | |
"""Stops the wheels""" | |
servos.position(left_wheel, degrees=90) | |
servos.position(right_wheel, degrees=90) | |
def fw_step(): | |
"""Moves the bot forward one step""" | |
servos.position(left_wheel, degrees=90 + wheel_speed) | |
servos.position(right_wheel, degrees=90 - wheel_speed + drift) | |
utime.sleep(straight_length) | |
stop() | |
def back_step(): | |
"""Moves the bot backwards one step""" | |
servos.position(left_wheel, degrees=90 - wheel_speed) | |
servos.position(right_wheel, degrees=90 + wheel_speed + drift) | |
utime.sleep(straight_length) | |
stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment