from machine import Pin
import utime
# Define LED pin
led_pin17 = 17 # The LED is connected to pin 25
led_pin18 = 18 # The LED is connected to pin 25
led_pin16 = 16 # The LED is connected to pin 25
# Initialize the LED pin as an output
led1 = Pin(led_pin16, Pin.OUT)
led2 = Pin(led_pin17, Pin.OUT)
led3 = Pin(led_pin18, Pin.OUT)
try:
while True:
# Turn on the LED
led1.value(1)
print("LED on")
utime.sleep(1) # Wait for 1 second
led1.value(0)
print("LED off")
utime.sleep(1) # Wait for 1 second
led2.value(1)
print("LED on")
utime.sleep(1) # Wait for 1 second
led2.value(0)
print("LED off")
utime.sleep(1) # Wait for 1 second
led3.value(1)
print("LED on")
utime.sleep(1) # Wait for 1 second
led3.value(0)
print("LED off")
utime.sleep(1) # Wait for 1 second
except KeyboardInterrupt:
# Clean up GPIO
led1.deinit()
led2.deinit()
led3.deinit()