Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to unique_board_id example #60

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions system/unique_board_id/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 8 additions & 4 deletions system/unique_board_id/unique_board_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}