#4 way traffic signal
from machine import Pin
from time import sleep
led1=Pin(32,Pin.OUT) #red
led2=Pin(33,Pin.OUT) #yellow
led3=Pin(25,Pin.OUT) #green
led4=Pin(21,Pin.OUT) #red
led5=Pin(22,Pin.OUT) #yellow
led6=Pin(23,Pin.OUT) #green
led7=Pin(5,Pin.OUT) #red
led8=Pin(18,Pin.OUT) #yellow
led9=Pin(19,Pin.OUT) #green
led10=Pin(17,Pin.OUT) #red
led11=Pin(16,Pin.OUT) #yellow
led12=Pin(4,Pin.OUT) #green
while True:
led1.on()
led2.off()
led3.off()
led4.off()
led5.off()
led6.on()
led7.on()
led8.off() #1
led9.off()
led10.on()
led11.off()
led12.off()
sleep(2)
led1.off()
led2.on()
led3.off()
led4.off()
led5.on()
led6.off()
led7.on() #2
led8.off()
led9.off()
led10.on()
led11.off()
led12.off()
sleep(2)
led1.off()
led2.off()
led3.on()
led4.on()
led5.off()
led6.off() #3
led7.on()
led8.off()
led9.off()
led10.on()
led11.off()
led12.off()
sleep(2)
led1.on()
led2.off()
led3.off()
led4.on()
led5.off()
led6.off()
led7.off() #4
led8.off()
led9.on()
led10.on()
led11.off()
led12.off()
sleep(2)
led1.on()
led2.off()
led3.off()
led4.on()
led5.off()
led6.off()
led7.off() #5
led8.on()
led9.off()
led10.off()
led11.on()
led12.off()
sleep(2)
led1.on()
led2.off()
led3.off()
led4.on()
led5.off()
led6.off()
led7.on()
led8.off() #6
led9.off()
led10.off()
led11.off()
led12.on()
sleep(2)