This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Written by Lonely Binary | |
Build-in LED On, Off and Toggle | |
The ESP-01S module features an onboard Blue LED that is intricately connected to GPIO2. | |
When GPIO2 is set to a logic LOW state, it closes the circuit, causing the LED to illuminate. | |
Conversely, when GPIO2 is set to a logic HIGH state, it opens the circuit, resulting in the LED being turned off. | |
ESP-01S Collection: | |
https://lonelybinary.com/collections/ESP-01S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include "time.h" | |
const char *ssid = "YOUR_WIFI_SSID"; | |
const char *password = "YOUR_WIFI_PASSWORD"; | |
const char *ntpServer = "ntp.lonelybinary.com"; | |
const long gmtOffset_sec = 3600L * 10; | |
const int daylightOffset_sec = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
/* | |
Get Current unix time stamp from https://www.unixtimestamp.com/ | |
TZ_INFO is "Australia/Sydney" | |
*/ | |
#define UNIX_TIMESTAMP 1687072944 | |
#define TZ_INFO "CST-10" | |
void set_time(time_t unix_time_t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In the following example, we will use preferences to record the ESP32 boot times. | |
*/ | |
#include <Preferences.h> | |
Preferences preferences; | |
String str_key_type(int key_type); | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Soft AP DHCP Server is enabled by default. | |
#include <WiFi.h> | |
#include <WiFiAP.h> | |
/* | |
Please provide the definition for the Soft AP SSID and Password. | |
The password should consist of at least 8 characters. | |
Alternatively, if no password is specified, the network will be open. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
//To switch to DHCP instead, simply modify to #define STATIC_IP 1 | |
#define STATIC_IP 0 | |
const char *ssid = "YOUR_WIFI_SSID"; | |
const char *password = "YOUR_WIFI_PASSWORD"; | |
#if defined(STATIC_IP) && STATIC_IP == 1 | |
IPAddress local_IP(192, 168, 31, 115); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <WiFiMulti.h> | |
WiFiMulti wifiMulti; | |
void setup() | |
{ | |
Serial.begin(115200); | |
Serial.println("Lonely Binary ESP32 Multi Wifi Example"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include "WiFi.h" | |
void setup() | |
{ | |
Serial.begin(115200); | |
Serial.println("Lonely Binary Wifi Scan Demo"); | |
/* |