pico-bmc/bmc.c
2024-02-07 13:43:52 -08:00

25 lines
693 B
C

#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include "secret.h"
int main() {
stdio_init_all();
if (cyw43_arch_init()) {
printf("Wi-Fi init failed\n");
return -1;
}
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");
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);
}
}