This commit is contained in:
2026-04-10 13:11:27 +02:00
parent e825475df3
commit b74366a546
5 changed files with 216 additions and 17 deletions

View File

@@ -1,24 +1,26 @@
#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include <stdbool.h>
#include <net/net.h>
int main(void) {
stdio_init_all();
// Initialise the Wi-Fi chip
if (cyw43_arch_init()) {
printf("Wi-Fi init failed\n");
return -1;
net_creds_t creds = {
.ssid = "5",
.password = "nevem123"
};
net_server_t* server = Net_Init(&creds);
if (!server) {
printf("Failed to initialize network\n");
return 1;
}
// Example to turn on the Pico W LED
bool led_on = true;
if (!Net_Listen(server)) {
printf("Failed to start server\n");
Net_Destroy(server);
return 1;
}
Net_Destroy(server);
while (true) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, led_on);
led_on = !led_on; // Toggle LED state
sleep_ms(1000);
}
return 0;
}