diff --git a/system/unique_board_id/CMakeLists.txt b/system/unique_board_id/CMakeLists.txt index 1a5b1f989..e17660868 100644 --- a/system/unique_board_id/CMakeLists.txt +++ b/system/unique_board_id/CMakeLists.txt @@ -12,3 +12,7 @@ pico_add_extra_outputs(unique_board_id) # add url via pico_set_program_url example_auto_set_url(unique_board_id) + +# enable both, usb output and uart output +pico_enable_stdio_usb(unique_board_id 1) +pico_enable_stdio_uart(unique_board_id 1) \ No newline at end of file diff --git a/system/unique_board_id/unique_board_id.c b/system/unique_board_id/unique_board_id.c index 6fb06c714..e4549a59c 100644 --- a/system/unique_board_id/unique_board_id.c +++ b/system/unique_board_id/unique_board_id.c @@ -24,9 +24,13 @@ int main() { pico_unique_board_id_t board_id; pico_get_unique_board_id(&board_id); - printf("Unique identifier:"); - for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { - printf(" %02x", board_id.id[i]); + while(1) { + printf("Unique identifier:"); + for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { + printf(" %02x", board_id.id[i]); + } + printf("\n"); + + sleep_ms(2000); } - printf("\n"); }