Skip to content

Instantly share code, notes, and snippets.

@CodeMaster7000
Created June 15, 2022 20:05
Show Gist options
  • Save CodeMaster7000/f4a639ccfc48439407921a3289b46b5b to your computer and use it in GitHub Desktop.
Save CodeMaster7000/f4a639ccfc48439407921a3289b46b5b to your computer and use it in GitHub Desktop.
A simple program to make your Raspberry Pi robot travel in a square.
from gpiozero import Robot
from time import sleep
robot = Robot(left = (7, 8), right = (9, 10))
while True:
robot.forward()
sleep(2)
robot.stop()
robot.right()
sleep(2)
robot.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment