Compare commits
No commits in common. "03329c5220ee433577bcbdc2c303836be4eb6a85" and "a0eb3ebaeb5985d16fd2505e5740b9936d3317da" have entirely different histories.
03329c5220
...
a0eb3ebaeb
@ -15,9 +15,6 @@
|
|||||||
ESP8266WebServer server(HTTP_PORT);
|
ESP8266WebServer server(HTTP_PORT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Durée de sommeil en microsecondes (par exemple, 5 secondes)
|
|
||||||
const int sleepDuration = 5 * 1000000;
|
|
||||||
|
|
||||||
// Fonction pour configurer et connecter au réseau Wi-Fi
|
// Fonction pour configurer et connecter au réseau Wi-Fi
|
||||||
void setup_wifi() {
|
void setup_wifi() {
|
||||||
delay(10);
|
delay(10);
|
||||||
@ -114,12 +111,6 @@ void setup_serial() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fonction pour mettre l'ESP8266 en mode deep sleep
|
|
||||||
void goToDeepSleep() {
|
|
||||||
DebugPort.println("Going to deep sleep...");
|
|
||||||
ESP.deepSleep(sleepDuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fonction d'initialisation principale
|
// Fonction d'initialisation principale
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
@ -141,9 +132,4 @@ void setup() {
|
|||||||
void loop() {
|
void loop() {
|
||||||
server.handleClient();
|
server.handleClient();
|
||||||
readTicPort();
|
readTicPort();
|
||||||
|
|
||||||
// Si aucune requête n'est en cours, mettre l'ESP8266 en mode deep sleep
|
|
||||||
if (server.client().available() == 0) {
|
|
||||||
goToDeepSleep();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user