Adding deep sleep test sketch
This commit is contained in:
23
src/main.cpp
23
src/main.cpp
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
AsyncElegantOTA Demo Example - This example will work for both ESP8266 & ESP32 microcontrollers.
|
AsyncElegantOTA Demo Example - This example will work for both ESP8266 & ESP32
|
||||||
|
microcontrollers.
|
||||||
-----
|
-----
|
||||||
Author: Ayush Sharma ( https://github.com/ayushsharma82 )
|
Author: Ayush Sharma ( https://github.com/ayushsharma82 )
|
||||||
|
|
||||||
@@ -9,24 +10,23 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <ESPAsyncTCP.h>
|
#include <ESPAsyncTCP.h>
|
||||||
#elif defined(ESP32)
|
#elif defined(ESP32)
|
||||||
#include <WiFi.h>
|
#include <AsyncTCP.h>
|
||||||
#include <AsyncTCP.h>
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <ESPAsyncWebServer.h>
|
|
||||||
#include <AsyncElegantOTA.h>
|
#include <AsyncElegantOTA.h>
|
||||||
|
#include <ESPAsyncWebServer.h>
|
||||||
|
|
||||||
const char* ssid = "JoNelsDarlings";
|
const char* ssid = "JoNelsDarlings";
|
||||||
const char* password = "Paris2016";
|
const char* password = "Paris2016";
|
||||||
|
|
||||||
AsyncWebServer server(80);
|
AsyncWebServer server(80);
|
||||||
|
|
||||||
|
|
||||||
void setup(void) {
|
void setup(void) {
|
||||||
Serial.begin(115200);
|
Serial.begin(9600);
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
@@ -42,7 +42,7 @@ void setup(void) {
|
|||||||
Serial.print("IP address: ");
|
Serial.print("IP address: ");
|
||||||
Serial.println(WiFi.localIP());
|
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.");
|
request->send(200, "text/plain", "Hi! This is a sample response.");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -51,5 +51,4 @@ void setup(void) {
|
|||||||
Serial.println("HTTP server started");
|
Serial.println("HTTP server started");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void) {
|
void loop(void) {}
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user