Advertisement
brendan-stanford

robo_triangle

Mar 24th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #import libraries
  2. from gpiozero import Robot
  3. from time import sleep
  4.  
  5. #setup robot motor pins
  6. robo = Robot(left=(8,7), right=(10,9))
  7.  
  8. #drive function
  9. for i in range(3):
  10. robo.forward()
  11. sleep(0.1)
  12. robo.left()
  13. sleep(0.3)
  14.  
  15. #stop command
  16. robo.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement