Skip to content

Commit 03240e2

Browse files
committed
Added lowPower screen frontLight off
1 parent c6d110c commit 03240e2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

examples/Inkplate6PLUS/Advanced_Inkplate_Features/Inkplate_Low_Power/Inkplate_Low_Power.ino

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ Inkplate display(INKPLATE_3BIT); // Create an object on Inkplate library and als
3939

4040
void setup()
4141
{
42-
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
43-
display.frontlight(0); // Turn off the front light
44-
display.tsShutdown(); // Turn off the touch screen
42+
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
43+
44+
// Turn frontlight on
45+
display.frontlight(1);
46+
display.setFrontlight(50);
47+
4548
display.clearDisplay(); // Clear frame buffer of display
4649
display.drawImage(
4750
pictures[slide], 0, 43, 1024,
@@ -52,6 +55,10 @@ void setup()
5255
if (slide > 2)
5356
slide = 0; // We do not have more than 3 images, so roll back to zero
5457

58+
// Turn off touchscreen and frontlight to save energy duiring deep sleep
59+
display.tsShutdown(); // Turn off the display touchscreen
60+
display.frontlight(0); // Turn off the frontlight
61+
5562
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
5663
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); // Activate wake-up timer -- wake up after 20s here
5764
esp_deep_sleep_start(); // Put ESP32 into deep sleep. Program stops here.

0 commit comments

Comments
 (0)