log via usb

This commit is contained in:
Arkitu 2025-02-22 20:25:53 +01:00
parent cecf2d079e
commit 4bd1d6f368
2 changed files with 17 additions and 3 deletions

View File

@ -34,11 +34,14 @@ project(blink C CXX ASM)
pico_sdk_init()
# Add executable. Default name is the project name, version 0.1
add_executable(blink
blink.c
)
# Modify the below lines to enable/disable output over UART/USB
pico_enable_stdio_uart(blink 0)
pico_enable_stdio_usb(blink 1)
add_library(zig_library STATIC IMPORTED)
set_property(TARGET zig_library PROPERTY IMPORTED_LOCATION ../zig-out/lib/libpicow_zig.a)

15
blink.c
View File

@ -5,6 +5,7 @@
*/
#include "pico/stdlib.h"
#include <pico/time.h>
#include <stdio.h>
#include <stdint.h>
@ -47,8 +48,18 @@ extern int32_t add(int32_t a, int32_t b);
int main() {
stdio_init_all();
printf("result from zig : %d\n", add(10, 31));
return 0;
// Initialise the Wi-Fi chip
if (cyw43_arch_init()) {
printf("Wi-Fi init failed\n");
return -1;
}
while (true) {
printf("result from zig : %d\n", add(10, 31));
sleep_ms(1000);
}
// int rc = pico_led_init();
// hard_assert(rc == PICO_OK);
// while (true) {