Add example code

It's just blinky
This commit is contained in:
Weckyy702
2026-02-22 01:05:23 +01:00
parent bad59fe733
commit 77549e0086
3 changed files with 48 additions and 0 deletions

21
CMakeLists.txt Normal file
View File

@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.20)
include(pico_sdk_import.cmake)
project(PicoNix C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 23)
pico_sdk_init()
add_executable(main
src/main.cpp
)
target_link_libraries(main
pico_stdlib
pico_cyw43_arch_none
)
pico_add_extra_outputs(main)

View File

@@ -31,6 +31,11 @@
inputsFrom = [ pico-sdk ];
packages = with pkgs;
[
gcc-arm-embedded
python3
usbutils
picotool
]
++ [ pico-sdk ];

22
src/main.cpp Normal file
View File

@@ -0,0 +1,22 @@
/**
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "pico/cyw43_arch.h"
#include "pico/stdlib.h"
int main() {
stdio_init_all();
if (cyw43_arch_init()) {
printf("Wi-Fi init failed");
return -1;
}
while (true) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
sleep_ms(500);
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
sleep_ms(500);
}
}