Intro to Micropython

from machine import Pin
import time

# Define the pin connected to the LED
led = Pin(2, Pin.OUT)

while True:
    led.value(not led.value())  # Toggle the LED state
    time.sleep(0.5)  # Wait for 0.5 seconds

Leave a Comment

Your email address will not be published. Required fields are marked *