Created
June 15, 2022 20:05
-
-
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.
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
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