aboutsummaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-03-31 16:34:59 +0200
committerlonkaars <loek@pipeframe.xyz>2024-03-31 16:34:59 +0200
commit41932400f68b7af671ee18df958c078e0c8d06e1 (patch)
tree1d9089134e0003f35db75b476d17d641128785cf /main/main.cpp
parent5ebe21c85c7001053c00d20d25195fececbcc7ce (diff)
wifi hello world working
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
new file mode 100644
index 0000000..e3e3b92
--- /dev/null
+++ b/main/main.cpp
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+#include "config.h"
+
+#include "pico/stdlib.h"
+#include "pico/cyw43_arch.h"
+
+int main() {
+ stdio_init_all();
+
+ if (cyw43_arch_init_with_country(CYW43_COUNTRY_UK)) {
+ printf("failed to initialize\n");
+ return 1;
+ }
+ printf("initialised\n");
+
+ cyw43_arch_enable_sta_mode();
+
+ if (cyw43_arch_wifi_connect_timeout_ms(CONF_NET_SSID, CONF_NET_PASS, CYW43_AUTH_WPA2_AES_PSK, 10000)) {
+ printf("failed to connect\n");
+ return 1;
+ }
+ printf("connected\n");
+}
+