Created
February 27, 2021 10:02
-
-
Save elktros/d2d1f50a1c6491bcee52caa59661a19d to your computer and use it in GitHub Desktop.
LED Blinky for Raspberry Pi Pico's on-board LED using toggle
This file contains 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
#Import Pin class from machine library to configure GPIO Pins. | |
from machine import Pin | |
#Import utime library to implement delay | |
import utime | |
#create an object of Pin class and set GPIO Parameters (GPIO Pin, Direction). | |
led_gpio25 = Pin(25, Pin.OUT) | |
#Create an infinite loop. This is similar to while(1) in C. | |
while True: | |
#Toggle the status of LED. | |
led_gpio25.toggle() | |
#sleep_ms function provides delay in milliseconds. | |
utime.sleep_ms(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment