From 8492869df2fc312b3fad228cd834231c528149c5 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 9 Oct 2022 17:38:03 -0400 Subject: [PATCH] added sleep test --- .../esp32-cam-send-jpeg-serial.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cubesatsim/esp32-cam-send-jpeg-serial/esp32-cam-send-jpeg-serial.ino b/cubesatsim/esp32-cam-send-jpeg-serial/esp32-cam-send-jpeg-serial.ino index a8cfe1b7..30ae8d9f 100644 --- a/cubesatsim/esp32-cam-send-jpeg-serial/esp32-cam-send-jpeg-serial.ino +++ b/cubesatsim/esp32-cam-send-jpeg-serial/esp32-cam-send-jpeg-serial.ino @@ -175,8 +175,12 @@ void deleteFile(fs::FS &fs, const char * path) { void setup() { - delay(5000); - +// delay(5000); + + #define uS_TO_S_FACTOR 1000000ULL /* Conversion factor for micro seconds to seconds */ + #define TIME_TO_SLEEP 10 /* Time ESP32 will go to sleep (in seconds) */ + esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); // testing sleep + Serial.begin(115200); initialize_camera();