Created
March 5, 2021 15:23
-
-
Save elktros/9cdd468f0d1ae176d6529135913f0169 to your computer and use it in GitHub Desktop.
C Program for Blinking on-board LED of Raspberry Pi Pico.
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
/** | |
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | |
* | |
* SPDX-License-Identifier: BSD-3-Clause | |
*/ | |
#include "pico/stdlib.h" | |
int main() { | |
const uint LED_PIN = 25; /* On-board LED. Connected to GPIO 25 */ | |
gpio_init(LED_PIN); /* Initialize GPIO function on the Pin */ | |
gpio_set_dir(LED_PIN, GPIO_OUT); /* Set the Pin as Output */ | |
while (true) { | |
gpio_put(LED_PIN, 1); /* Make the GPIO Pin HIGH */ | |
sleep_ms(250); /* Delay of 250ms */ | |
gpio_put(LED_PIN, 0); /* Make the GPIO Pin LOW */ | |
sleep_ms(250); /* Delay of 250ms */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment