from machine import Pin
from time import sleep
# Set up an external LED connected to GP pin 0
led = Pin(0, Pin.OUT)
# Initialize cycle counter
count = 0
while True:
# Blink ON for 1 seconds, OFF for 1 seconds
led.on() # Turn the LED ON
sleep(1) # Wait for 1 seconds
led.off() # Turn the LED OFF
sleep(1) # Wait for 1 seconds
# Increment the cycle count
count = count + 1
# After every 5 cycles, turn the LED OFF for 5 seconds
if count == 5:
led.off() # Turn LED OFF
sleep(5) # Wait for 5 seconds
count = 0 # Reset the cycle count after 5 cycles