pico-bmc/bmc.c

25 lines
693 B
C
Raw Normal View History

2024-02-07 08:52:03 +00:00
#include <stdio.h>
2024-02-07 07:08:07 +00:00
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
2024-02-07 21:43:52 +00:00
#include "secret.h"
2024-02-07 07:08:07 +00:00
int main() {
stdio_init_all();
if (cyw43_arch_init()) {
2024-02-07 21:43:52 +00:00
printf("Wi-Fi init failed\n");
2024-02-07 07:08:07 +00:00
return -1;
}
2024-02-07 21:43:52 +00:00
printf("Wi-Fi init succeeded\n");
cyw43_arch_enable_sta_mode();
if (cyw43_arch_wifi_connect_timeout_ms(ssid, pass, CYW43_AUTH_WPA2_AES_PSK, 10000)) {
printf("WiFi failed to connect\n");
return -1;
}
printf("WiFi connected\n");
2024-02-07 07:08:07 +00:00
while (true) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
sleep_ms(1000);
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
sleep_ms(1000);
}
}