import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin, PWM
import time
servo = PWM(Pin(1))
servo.freq(1000)
duty = 5000
servo.duty_u16(duty)
print("Touches :")
print("+ : augmenter")
print("- : diminuer")
print("q : quitter")
while True:
print("Valeur actuelle :", duty)
cmd = input("Commande : ")
if cmd == "+":
duty += 200
if duty > 65535:
duty = 65535
servo.duty_u16(duty)
elif cmd == "-":
duty -= 200
if duty < 0:
duty = 0
servo.duty_u16(duty)
elif cmd == "q":
break