from machine import Pin
from utime import sleep
b0=Pin(0,Pin.OUT)
b1=Pin(1,Pin.OUT)
b2=Pin(2,Pin.OUT)
b3=Pin(3,Pin.OUT)
bulb=[b0,b1,b2,b3]
c=0
def dec_to_bin(x):
r=[]
while(x>0):
r.append(x%2)
x=x//2
return r
while True:
b=dec_to_bin(c)
on=0
for i in b:
if i==1:
bulb[on].value(1)
on+=1
print("Turned on for ",c,b)
sleep(1)
for b in bulb:
b.value(0)
c+=1
c=c%16