from machine import Pin
from time import sleep
buttonPin = 25
LEDPin = 26
button_state = 0
led_state = 0
led = Pin(LEDPin, Pin.OUT)
push_button = Pin(buttonPin, Pin.IN, Pin.PULL_UP)
while True:
last_State = button_state
button_state = push_button.value()
if button_state == 0 and last_State == 1:
led_state = not(led_state)
led.value(led_state)
sleep(0.1)