Skip to content

Commit e941d6a

Browse files
committed
Added possibility to change an image on the wakeup button in Image_Frame_From_SD examples
1 parent 496051d commit e941d6a

File tree

6 files changed

+48
-18
lines changed

6 files changed

+48
-18
lines changed

examples/Inkplate10/Projects/Inkplate10_Image_Frame_From_SD/Inkplate10_Image_Frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
21 February 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -171,13 +173,16 @@ int getFileCount()
171173
}
172174

173175
/**
174-
* @brief Go to deep sleep.
176+
* @brief Go to deep sleep and enable wakeup on the wake button.
175177
*/
176178
void deepSleep()
177179
{
178180
// Turn off the power supply for the SD card
179181
display.sdCardSleep();
180182

183+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
184+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
185+
181186
// Put ESP32 into deep sleep (low power mode)
182187
esp_deep_sleep_start();
183188
}

examples/Inkplate4/Projects/Inkplate4_Image_Frame_From_SD/Inkplate4_Image_Frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
11 April 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -163,13 +165,16 @@ int getFileCount()
163165
}
164166

165167
/**
166-
* @brief Go to deep sleep.
168+
* @brief Turn off all peripherals, go to deep sleep, and enable wakeup on the wake button.
167169
*/
168170
void deepSleep()
169171
{
170172
// Turn off the power supply for the SD card
171173
display.sdCardSleep();
172174

175+
// Put the panel in the deep sleep
176+
display.setPanelDeepSleep(0);
177+
173178
// Enable wakeup from deep sleep on gpio 36 (wake button)
174179
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
175180

examples/Inkplate5/Projects/Inkplate5_Image_Frame_From_SD/Inkplate5_Image_Frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
28 March 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -169,13 +171,16 @@ int getFileCount()
169171
}
170172

171173
/**
172-
* @brief Go to deep sleep.
174+
* @brief Go to deep sleep and enable wakeup on the wake button.
173175
*/
174176
void deepSleep()
175177
{
176178
// Turn off the power supply for the SD card
177179
display.sdCardSleep();
178180

181+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
182+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
183+
179184
// Put ESP32 into deep sleep (low power mode)
180185
esp_deep_sleep_start();
181186
}

examples/Inkplate6/Projects/Inkplate6_Image_Frame_From_SD/Inkplate6_Image_Frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
21 February 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -171,13 +173,16 @@ int getFileCount()
171173
}
172174

173175
/**
174-
* @brief Go to deep sleep.
176+
* @brief Go to deep sleep and enable wakeup on the wake button.
175177
*/
176178
void deepSleep()
177179
{
178180
// Turn off the power supply for the SD card
179181
display.sdCardSleep();
180182

183+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
184+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
185+
181186
// Put ESP32 into deep sleep (low power mode)
182187
esp_deep_sleep_start();
183188
}

examples/Inkplate6COLOR/Projects/Inkplate6COLOR_Image_Frame_From_SD/Inkplate6COLOR_Image_Frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
21 February 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -170,7 +172,7 @@ int getFileCount()
170172
}
171173

172174
/**
173-
* @brief Go to deep sleep.
175+
* @brief Turn off all peripherals, go to deep sleep, and enable wakeup on the wake button.
174176
*/
175177
void deepSleep()
176178
{
@@ -180,6 +182,9 @@ void deepSleep()
180182
// Put the panel in the deep sleep
181183
display.setPanelDeepSleep(0);
182184

185+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
186+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
187+
183188
// Put ESP32 into deep sleep (low power mode)
184189
esp_deep_sleep_start();
185190
}

examples/Inkplate6PLUS/Projects/Inkplate6PLUS_Image_frame_From_SD/Inkplate6PLUS_Image_frame_From_SD.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Format your SD card in standard FAT file format.
1212
1313
This example will show you how you can make slideshow images from an SD card. Put your images on
14-
the SD card in a file and specify the file path in the sketch.
14+
the SD card in a file and specify the file path in the sketch. If you don't want to wait defined delay time,
15+
you can press the wake button and the next image will be loaded on the screen. It will take some time until
16+
the image will be loaded.
1517
1618
Want to learn more about Inkplate? Visit www.inkplate.io
1719
Looking to get support? Write on our forums: https://forum.soldered.com/
18-
21 February 2023 by Soldered
20+
12 April 2023 by Soldered
1921
*/
2022

2123
// Next 3 lines are a precaution, you can ignore those, and the example would also work without them
@@ -171,13 +173,16 @@ int getFileCount()
171173
}
172174

173175
/**
174-
* @brief Go to deep sleep.
176+
* @brief Go to deep sleep and enable wakeup on the wake button.
175177
*/
176178
void deepSleep()
177179
{
178180
// Turn off the power supply for the SD card
179181
display.sdCardSleep();
180182

183+
// Enable wakeup from deep sleep on GPIO 36 (wake button)
184+
esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW);
185+
181186
// Put ESP32 into deep sleep (low power mode)
182187
esp_deep_sleep_start();
183188
}

0 commit comments

Comments
 (0)