Add Bluetooth examples
Co-authored-by: Peter Harper <77111776+peterharperuk@users.noreply.github.com>
This commit is contained in:
14
pico_w/wifi/blink/CMakeLists.txt
Normal file
14
pico_w/wifi/blink/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
add_executable(picow_blink
|
||||
picow_blink.c
|
||||
)
|
||||
|
||||
target_link_libraries(picow_blink
|
||||
pico_stdlib # for core functionality
|
||||
pico_cyw43_arch_none # we need Wifi to access the GPIO, but we don't need anything else
|
||||
)
|
||||
|
||||
# create map/bin/hex file etc.
|
||||
pico_add_extra_outputs(picow_blink)
|
||||
|
||||
# add url via pico_set_program_url
|
||||
example_auto_set_url(picow_blink)
|
||||
22
pico_w/wifi/blink/picow_blink.c
Normal file
22
pico_w/wifi/blink/picow_blink.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/cyw43_arch.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(250);
|
||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
|
||||
sleep_ms(250);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user