from machine import Pin
from time import sleep
button_Pin=14 # GPIO14 for button
led_Pin=25 # GPIO12 for LED
button=Pin(button_Pin,Pin.IN,Pin.PULL_UP)
led=Pin(led_Pin,Pin.OUT)
while True:
if not button.value(): # button is pressed(active low)
led.value(1) #turn on the Led
else:
led.value(0) # turn off the led
sleep(0.1) # small delay to debounce the button