You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
521 B
Python
26 lines
521 B
Python
from machine import Pin
|
|
from servo import Servo
|
|
from time import sleep
|
|
|
|
p21 = Pin(21)
|
|
|
|
s21 = Servo(p21, freq=50, min_us=500, max_us=2500,
|
|
degrees=270)
|
|
|
|
while True:
|
|
print("Position: 0")
|
|
s21.position(degrees=0)
|
|
sleep(2)
|
|
print("Position: 30")
|
|
s21.position(degrees=30)
|
|
sleep(2)
|
|
print("Position: 60")
|
|
s21.position(degrees=60)
|
|
sleep(2)
|
|
print("Position: 90")
|
|
s21.position(degrees=90)
|
|
sleep(2)
|
|
print("Position: 120")
|
|
s21.position(degrees=120)
|
|
sleep(2)
|