Skip to content

Commit

Permalink
Added Wi-Fi
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfraz committed Aug 12, 2024
1 parent e70fe26 commit 8cc80ed
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/Wi-Fi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Wi-Fi

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.

TODO codeblock

## Sources

- [ESP32 - HTTP Request](https://esp32io.com/tutorials/esp32-http-request)
20 changes: 20 additions & 0 deletions examples/Wi-Fi/sketch/sketch.ino
Original file line number Diff line number Diff line change
@@ -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);
Serial.println("Connecting");
while(WiFi.status() != WL_CONNECTED) {
Serial.println("Failed to connect");
delay(1000);
}
}

void loop() {
Serial.println("Connected");
delay(1000);
}

0 comments on commit 8cc80ed

Please # to comment.