]>
git.scottworley.com Git - tattlekey/blob - client/tattlekey.c
76e9168df08da2640a8ce3ff8a94a2eaa329ca5b
1 #include "pico/cyw43_arch.h"
2 #include "pico/stdlib.h"
4 char ssid
[] = "THEWIFISSID";
5 char pass
[] = "THEWIFIPASSWORD";
7 void one_blink(int duration
) {
8 cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN
, 1);
10 cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN
, 0);
14 void signal(int count
, int duration
) {
15 for (int i
= 0; i
< count
; i
++)
20 void blink_forever(int duration
) {
26 void signal_error_by_blinking() { blink_forever(100); }
27 void signal_success_by_blinking() { blink_forever(400); }
31 if (cyw43_arch_init_with_country(CYW43_COUNTRY_USA
))
32 signal_error_by_blinking();
34 cyw43_arch_enable_sta_mode();
36 if (cyw43_arch_wifi_connect_timeout_ms(ssid
, pass
, CYW43_AUTH_WPA2_AES_PSK
,
38 signal_error_by_blinking();
40 signal_success_by_blinking();