forked from andrey/raspberry-pi-pico-docker-sdk
Add SDK test and reorganize repository
This commit is contained in:
18
test_poject/CMakeLists.txt
Normal file
18
test_poject/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
|
||||
|
||||
project(sample C CXX ASM)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
pico_sdk_init()
|
||||
|
||||
add_executable(sample main.c)
|
||||
|
||||
pico_enable_stdio_usb(sample 1)
|
||||
pico_enable_stdio_uart(sample 1)
|
||||
pico_add_extra_outputs(sample)
|
||||
|
||||
target_link_libraries(sample pico_stdlib)
|
||||
27
test_poject/main.c
Normal file
27
test_poject/main.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include "pico/stdlib.h"
|
||||
#include "hardware/gpio.h"
|
||||
#include "pico/binary_info.h"
|
||||
|
||||
const int LED_PIN = 25;
|
||||
|
||||
int main ()
|
||||
{
|
||||
bi_decl(bi_program_description("Sample binary"));
|
||||
bi_decl(bi_1pin_with_name(LED_PIN, "on-board PIN"));
|
||||
|
||||
stdio_init_all();
|
||||
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
|
||||
while(1)
|
||||
{
|
||||
gpio_put(LED_PIN, 0);
|
||||
sleep_ms(250);
|
||||
gpio_put(LED_PIN, 1);
|
||||
puts("Hello Word\n");
|
||||
sleep_ms(1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user