Adding deep sleep test sketch
This commit is contained in:
33
src/main.cpp
33
src/main.cpp
@@ -1,32 +1,32 @@
|
||||
/*
|
||||
AsyncElegantOTA Demo Example - This example will work for both ESP8266 & ESP32 microcontrollers.
|
||||
-----
|
||||
Author: Ayush Sharma ( https://github.com/ayushsharma82 )
|
||||
/*
|
||||
AsyncElegantOTA Demo Example - This example will work for both ESP8266 & ESP32
|
||||
microcontrollers.
|
||||
-----
|
||||
Author: Ayush Sharma ( https://github.com/ayushsharma82 )
|
||||
|
||||
Important Notice: Star the repository on Github if you like the library! :)
|
||||
Repository Link: https://github.com/ayushsharma82/AsyncElegantOTA
|
||||
Important Notice: Star the repository on Github if you like the library! :)
|
||||
Repository Link: https://github.com/ayushsharma82/AsyncElegantOTA
|
||||
*/
|
||||
#include <Arduino.h>
|
||||
|
||||
#if defined(ESP8266)
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESPAsyncTCP.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESPAsyncTCP.h>
|
||||
#elif defined(ESP32)
|
||||
#include <WiFi.h>
|
||||
#include <AsyncTCP.h>
|
||||
#include <AsyncTCP.h>
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
|
||||
#include <ESPAsyncWebServer.h>
|
||||
#include <AsyncElegantOTA.h>
|
||||
#include <ESPAsyncWebServer.h>
|
||||
|
||||
const char* ssid = "JoNelsDarlings";
|
||||
const char* password = "Paris2016";
|
||||
|
||||
AsyncWebServer server(80);
|
||||
|
||||
|
||||
void setup(void) {
|
||||
Serial.begin(115200);
|
||||
Serial.begin(9600);
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(ssid, password);
|
||||
Serial.println("");
|
||||
@@ -42,14 +42,13 @@ void setup(void) {
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||
server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||
request->send(200, "text/plain", "Hi! This is a sample response.");
|
||||
});
|
||||
|
||||
AsyncElegantOTA.begin(&server); // Start AsyncElegantOTA
|
||||
AsyncElegantOTA.begin(&server); // Start AsyncElegantOTA
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
}
|
||||
void loop(void) {}
|
||||
Reference in New Issue
Block a user