# Source: https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico/8
# Modified by Barbu Vulc!
# You can either uncomment 1st/2nd code in order to see what it does!
# Simply select one code/the other & press Ctrl+K+C to comment/Ctrl+K+U to uncomment.
# --------------------------------------------------------------------------------- #
# 1. Read analog inputs from potentiometer!
# from machine import ADC, Pin
# import time
# adc = ADC(Pin(27))  #Potentiometer connected to pin GP27...
# while True:
#     print(adc.read_u16())
#     time.sleep(1)
# --------------------------------------------------------------------------------- #
# 2. Control an LED with potentiometer!
# from machine import Pin, PWM, ADC
# LED = PWM(Pin(18))  #LED connected to pin GP18...
# adc = ADC(Pin(27))  #Potentiometer connected to pin GP27...
# LED.freq(1000)
# while True:
# 	duty = adc.read_u16()
# 	LED.duty_u16(duty)