import servo
import machine

SERVO_PIN = 23
POT_PIN = 34

def main():
    pot = machine.ADC(machine.Pin(POT_PIN))
    s = servo.Servo(machine.Pin(SERVO_PIN))
    print("running...")
    while True:
        speed = pot.read()
        # create 'dead zone' at bottom of throw
        if speed < 100:
            speed = 0
        s.write(speed/4096 * 180)
        machine.idle()

if __name__ == "__main__":
    main()