from machine import Pin
from time import sleep
led= Pin(25,Pin.OUT)
pushbutton = Pin(4,Pin.IN,Pin.PULL_UP)
def blink_led_ntimes(num, t_on, t_off, msg):
counter = 0
while (counter < num):
led.on()
sleep(t_on)
led.off()
sleep(t_off)
counter += 1
print("counter =",counter)
print (msg)
while True:
if (pushbutton.value() == 0):
blink_led_ntimes(8,0.50,0.50,'Done.')