from machine import Pin
from utime import sleep
red1=Pin(0,Pin.OUT)
blue1=Pin(1,Pin.OUT)
yellow1=Pin(2,Pin.OUT)
red2=Pin(3,Pin.OUT)
blue2=Pin(11,Pin.OUT)
yellow2=Pin(6,Pin.OUT)
def decToBinary(lst,num):
i=0
while(num>0):
lst[i]=num%2
num=num//2
i+=1
return lst
def blinklight(zst,fst):
for i in zst:
if(i==3):
red1.toggle()
elif(i==2):
blue1.toggle()
elif(i==1):
yellow1.toggle()
for i in fst:
if(i==3):
red2.toggle()
elif(i==2):
blue2.toggle()
elif(i==1):
yellow2.toggle()
num=5
lst=[0]*3
decToBinary(lst,num)
rep=lst[:5][::-1]
zst=[0]*3
fst=[0]*3
j = 0
cnt=0
for i in rep :
if i == 1:
fst[j] = 3 - cnt
cnt+=1
else:
zst[j] = 3 - cnt
cnt+=1
j += 1
blinklight(zst,fst)