2026IoTPicowLab/Lab10/MicroPython/Code/blink_internal.py
2026-04-07 08:09:12 -04:00

18 lines
455 B
Python

# Micropython version of the blink program
import machine
import time
print("\nMicroPython example code")
print("Blink the onboard LED\n")
led = machine.Pin('LED', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class
while True:
print("On")
led.value(True) #turn on the LED
time.sleep(1) #wait for one second
print("Off")
led.value(False) #turn off the LED
time.sleep(1) #wait for one second