from machine import Pin
from utime import sleep
relay = Pin(18, Pin.OUT)
on_duration = 1.8
off_duration = .6
while True:
relay.value(1)
sleep (on_duration)
relay.value(0)
sleep(off_duration)
from machine import Pin
from utime import sleep
relay = Pin(18, Pin.OUT)
on_duration = 1.8
off_duration = .6
while True:
relay.value(1)
sleep (on_duration)
relay.value(0)
sleep(off_duration)