Last active
January 12, 2025 01:23
-
-
Save gallaugher/7c5b2d2765f8c03b8fe0d867353e5bef to your computer and use it in GitHub Desktop.
cp-blink.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code that simply prints a message to the console & flashes the onboard LED every 0.5 seconds | |
import time, board, digitalio | |
print("*** CircuitPython is Awesome! ***") | |
print("*** Look at your board - the LED light should be blinking ***") | |
led = digitalio.DigitalInOut(board.LED) | |
led.direction = digitalio.Direction.OUTPUT | |
while True: | |
led.value = True | |
time.sleep(0.5) | |
led.value = False | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blinks the LED light on CircuitPython boards that support the board.LED object.