from machine import Pin
from utime import sleep_ms, ticks_ms, ticks_diff
button1 = Pin(0, Pin.IN, Pin.PULL_UP)
button2 = Pin(1, Pin.IN, Pin.PULL_UP)
led = Pin(2, Pin.OUT)
while True:
if button2.value() == 0:
while button1.value() == 1:
led.on() # Turn on the LED
sleep_ms(1000)
led.off()
sleep_ms(1000)
led.off()
sleep_ms(1000)