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)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT
NOCOMNCVCCGNDINLED1PWRRelay Module