# Project objective: Control the brightness of an LED using a potentiometer and picozero module
# 
# Hardware and connections used:
#   LED to GPIO Pin 15
#   220 ohm resistor for the LED
#   Potentiometer SIG pin to GPIO Pin 28 (capable of ADC)
#
# Programmer: Adrian Josele G. Quional

# importing Pot and LED class from the picozero module
from picozero import Pot, LED

# creating potentiometer and LED objects
pot = Pot(28)
led = LED(15)

# continuously control the brightness of the LED using the potentiometer
while True:
    # directly convert potentiometer values to brightness values
    led.value = pot.value
$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT