import machine
import time
led1 = machine.Pin(0, machine.Pin.OUT)
led2 = machine.Pin(3, machine.Pin.OUT)
led3 = machine.Pin(5, machine.Pin.OUT)
led4 = machine.Pin(8, machine.Pin.OUT)
led5 = machine.Pin(10, machine.Pin.OUT)
led6 = machine.Pin(13, machine.Pin.OUT)
led7 = machine.Pin(15, machine.Pin.OUT)
relay = machine.Pin(16, machine.Pin.OUT)
relay.value(1)
S = 0.1 #sleep time
A1 = 3 #on time
A2 = 3 #off time
while True:
led1.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led1.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led2.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led2.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led3.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led3.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led4.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led4.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led5.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led5.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led6.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led6.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
led7.value(1) # Turn LED on (HIGH)
time.sleep(S) # Wait
led7.value(0) # Turn LED off (LOW)
time.sleep(S) # Wait
relay.value(0)
time.sleep(A1) # Wait
relay.value(1)
time.sleep(A2) # Wait
relay.value(0)
time.sleep(A1) # Wait
relay.value(1)
time.sleep(A2) # Wait
relay.value(0)
time.sleep(A1) # Wait
relay.value(1)
time.sleep(A2) # Wait