pico w go blinky!
This commit is contained in:
parent
7ace6bfa85
commit
ca2b80f906
|
@ -12,7 +12,10 @@ add_executable(vibe-check
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add pico_stdlib library which aggregates commonly used features
|
# Add pico_stdlib library which aggregates commonly used features
|
||||||
target_link_libraries(vibe-check pico_stdlib)
|
target_link_libraries(vibe-check
|
||||||
|
pico_stdlib
|
||||||
|
pico_cyw43_arch_none
|
||||||
|
)
|
||||||
|
|
||||||
# create map/bin/hex/uf2 file in addition to ELF.
|
# create map/bin/hex/uf2 file in addition to ELF.
|
||||||
pico_add_extra_outputs(vibe-check)
|
pico_add_extra_outputs(vibe-check)
|
||||||
|
|
7
README.md
Normal file
7
README.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```
|
||||||
|
# env -C lib/pico-sdk/ git submodule update --init
|
||||||
|
# env -C build/ cmake .. -G Ninja -DPICO_BOARD=pico_w -DWIFI_SSID=YOUR_SSID_HERE -DWIFI_PASSWORD="your password here"
|
||||||
|
# env -C build/ ninja
|
||||||
|
```
|
18
src/main.c
18
src/main.c
|
@ -1,8 +1,24 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "pico/stdlib.h"
|
#include "pico/stdlib.h"
|
||||||
|
#include "pico/cyw43_arch.h"
|
||||||
|
|
||||||
|
#ifndef CYW43_WL_GPIO_LED_PIN
|
||||||
|
#error no WiFi LED on board, wrong -DPICO_BOARD?
|
||||||
|
#endif
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
setup_default_uart();
|
stdio_init_all();
|
||||||
|
if (cyw43_arch_init()) {
|
||||||
|
printf("Wi-Fi init failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
while (true) {
|
||||||
printf("Hello, world!\n");
|
printf("Hello, world!\n");
|
||||||
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
|
||||||
|
sleep_ms(250);
|
||||||
|
printf("Goodbye, world!\n");
|
||||||
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
|
||||||
|
sleep_ms(250);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue