from machine import Pin
from time import sleep
R=Pin(7,Pin.OUT)
G=Pin(6,Pin.OUT)
B=Pin(5,Pin.OUT)
L1=Pin(15,Pin.OUT)
L2=Pin(14,Pin.OUT)
L3=Pin(13,Pin.OUT)
L4=Pin(12,Pin.OUT)
L5=Pin(11,Pin.OUT)
L6=Pin(10,Pin.OUT)
L7=Pin(9,Pin.OUT)
L8=Pin(8,Pin.OUT)
while True:
print("853_Kapil Maurya")
print("Single LED Blinking")
# Red + Blue
R.on(); B.on()
for L in [L1,L2,L3,L4,L5,L6,L7,L8]:
L.on(); sleep(1); L.off()
R.off(); B.off(); sleep(2)
print("Double LED Blinking")
# Blue + Green
B.on(); G.on()
for A in [(L1,L2),(L3,L4),(L5,L6),(L7,L8)]:
for L in A: L.on()
sleep(1)
for L in A: L.off()
B.off(); G.off(); sleep(2)
print("Alternate LED Blinking")
# Red + Green
R.on(); G.on()
for A in [(L1,L3,L5,L7),(L2,L4,L6,L8)]:
for L in A: L.on()
sleep(1)
for L in A: L.off()
R.off(); G.off(); sleep(2)
print("Opposite LED Blinking")
# Blue
B.on()
for A in [(L1,L8),(L2,L7),(L3,L6),(L4,L5)]:
for L in A: L.on()
sleep(1)
for L in A: L.off()
B.off(); sleep(2)
print("Nibble LED Blinking")
# Green
G.on()
for A in [(L1,L2,L3,L4),(L5,L6,L7,L8)]:
for L in A: L.on()
sleep(1)
for L in A: L.off()
G.off(); sleep(3)