Function to test the SDK
This commit is contained in:
parent
3b32a4c37b
commit
61d4458f23
3 changed files with 157 additions and 0 deletions
23
test/test.c
Normal file
23
test/test.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
#include "hardware/gpio.h"
|
||||
#include "pico/binary_info.h"
|
||||
|
||||
const uint LED_PIN = 0;
|
||||
|
||||
int main () {
|
||||
bi_decl(bi_program_description("Blink"));
|
||||
bi_decl(bi_1pin_with_name(LED_PIN, "Onboard LED"));
|
||||
|
||||
stdio_init_all();
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
|
||||
while (1) {
|
||||
gpio_put(LED_PIN, 1);
|
||||
sleep_ms(1000);
|
||||
gpio_put(LED_PIN, 0);
|
||||
sleep_ms(1000);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue