from machine import Pin
from time import sleep
led1=Pin(0,Pin.OUT)
led2=Pin(1,Pin.OUT)
led3=Pin(2,Pin.OUT)
led4=Pin(3,Pin.OUT)
temp=0
while True:
temp+=1
sleep(0.5)
if temp%2>0:
led4.on()
else:
led4.off()
if temp%4>1:
led3.on()
else:
led3.off()
if temp%8>3:
led2.on()
else:
led2.off()
if temp%16>7:
led1.on()
else:
led1.off()
if temp==15:
break
sleep(0.5)