pid-balancer/min-max-demo.py
2024-12-16 15:25:32 +01:00

25 lines
431 B
Python

# Example Python Servo Script #1
# Once connected the easiest way to get your servo moving is to use the Gpiozero library in a Python script.
from gpiozero import Servo
from time import sleep
myGPIO = 17
servo = Servo(myGPIO)
while True:
servo.mid()
print("mid")
sleep(0.5)
servo.min()
print("min")
sleep(1)
servo.mid()
print("mid")
sleep(0.5)
servo.max()
print("max")
sleep(1)