# Project objective: Light up an external LED when a push button is pressed
#
# Hardware and connections used:
#   Push button to GPIO Pin 16
#   10000 ohm pull-down resistor for the push button
#   LED to GPIO Pin 15
#   220 ohm resistor for LED
# 
# Programmer: Adrian Josele G. Quional

# modules
from machine import Pin
from time import sleep

LED = Pin(15, Pin.OUT)      # creating LED object, setting it as OUT
BUTTON = Pin(16, Pin.IN)    # creating Push Button object, setting it as IN

# continuously read the signal from the push button while the board has power
while True:
    # if the signal from the button is HIGH (button is pressed), turn LED on
    if BUTTON.value() == 1:
        LED.on()
        sleep(0.1)

    # otherwise, turn the LED off
    else:
        LED.off()
$abcdeabcde151015202530fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
btn1:1.l
btn1:2.l
btn1:1.r
btn1:2.r
led1:A
led1:C
r1:1
r1:2
r2:1
r2:2