from machine import Pin
import time
led1 = Pin(15,Pin.OUT)
led2 = Pin(14,Pin.OUT)
led3 = Pin(13,Pin.OUT)
def turn_off_all():
led1.value(0)
led2.value(0)
led3.value(0)
choice=input("Do you want to turn on light? (y/n): ")
stop=input("type stop to make program end: ")
while choice=="y":
led1.toggle()
time.sleep(0.5)
led2.toggle()
time.sleep(1)
led3.toggle()
time.sleep(1.5)
if stop=="stop":
turn_off_all()
print("Program ended.")