from machine import Pin, ADC
from servo import Servo
import time
SERVO_PIN = 2
POT_PIN = 12
motor = Servo(pin=SERVO_PIN)
pot = ADC(Pin(POT_PIN))
while True:
pot_value = pot.read()
angle = (pot_value / 4095) * 180
motor.move(int(angle))
time.sleep(0.1)
print(angle)