Connect Raspberry Pi Pico board VBus and GND pin to the bread board by using wires.
Connect 220 Ω Resistor to the LED Anode (+) pin and LED cathode (-) pin to Gnd.
Connect 220 Ω Resistor another pin to GP16.
Connect 10 k Ω Resistor to the switch button.
Connect switch button another pin to the Raspberry Pi Pico pin GP17.
When we press the push button LED blinks.
Check the Python program.
Check the circuit connections.
Run the Python program.
Python Program
from machine import Pin
from time import sleep
led_pin = Pin(16, Pin.OUT) # 16 number in is Output
push_button = Pin(17, Pin.IN) # 17 number pin is input
while True:
logic_state = push_button.value()
if logic_state == True: # if push_button pressed
led_pin.value(1) # led will turn ON
else: # if push_button not pressed
led_pin.value(0)