1 parent e70fe26 commit 8cc80edCopy full SHA for 8cc80ed
2 files changed
examples/Wi-Fi/README.md
@@ -0,0 +1,9 @@
1
+# Wi-Fi
2
+
3
+This code shows how to connect to Wi-Fi network. You usually use it in `setup()` method when you need network connectivity for your project.
4
5
+TODO codeblock
6
7
+## Sources
8
9
+- [ESP32 - HTTP Request](https://esp32io.com/tutorials/esp32-http-request)
examples/Wi-Fi/sketch/sketch.ino
@@ -0,0 +1,20 @@
+#include <WiFi.h>
+const char WIFI_SSID[] = "YOUR_SSID"; // TODO change
+const char WIFI_PASSWORD[] = "YOUR_PASSWORD"; // TODO change
+void setup() {
+ Serial.begin(9600);
+ WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
10
+ Serial.println("Connecting");
11
+ while(WiFi.status() != WL_CONNECTED) {
12
+ Serial.println("Failed to connect");
13
+ delay(1000);
14
+ }
15
+}
16
17
+void loop() {
18
+ Serial.println("Connected");
19
20
0 commit comments