Skip to content

Commit 5cdca75

Browse files
committed
fix
2 parents e03afda + 020b2d8 commit 5cdca75

File tree

25 files changed

+1180
-37
lines changed

25 files changed

+1180
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vscode/
22
build/
3+
Build/
34
examples/.DS_Store
45
.DS_Store

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Low_Power/Inkplate_Low_Power.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ void setup()
5050
if (slide > 2)
5151
slide = 0; // We do not have more than 3 images, so roll back to zero
5252

53-
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
53+
// Uncomment this line if your Inkplate is older than Aug 2021 as older Inkplates have ESP32 wrover-e chips
54+
// rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
5455
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); // Activate wake-up timer -- wake up after 20s here
5556
esp_deep_sleep_start(); // Put ESP32 into deep sleep. Program stops here.
5657
}

examples/Inkplate10/Advanced_Inkplate_Features/Inkplate_Partial_Update_With_Deep_Sleep/Inkplate_Partial_Update_With_Deep_Sleep.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ void setup()
6565
}
6666
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP *
6767
uS_TO_S_FACTOR); // Set EPS32 to be woken up in 10 seconds (in this case)
68-
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
69-
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
68+
69+
// Uncomment this line if your Inkplate is older than Aug 2021 as older Inkplates have ESP32 wrover-e chips
70+
// rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
71+
72+
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
7073
}
7174

7275
void loop()

examples/Inkplate10/Basic_Inkplate_Functionality/Inkplate_Basic_Partial_Update/Inkplate_Basic_Partial_Update.ino

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void setup()
4343

4444
void loop()
4545
{
46+
// BASIC USAGE
47+
4648
display.clearDisplay(); // Clear content in frame buffer
4749
display.setCursor(offset, 400); // Set new position for text
4850
display.print(text); // Write text at new position
@@ -60,4 +62,28 @@ void loop()
6062
if (offset < 0)
6163
offset = 1200; // Text is scrolled till the end of the screen? Get it back on the start!
6264
delay(500); // Delay between refreshes.
65+
66+
67+
// ADVANCED USAGE
68+
69+
display.clearDisplay(); // Clear content in frame buffer
70+
display.setCursor(offset, 400); // Set new position for text
71+
display.print(text); // Write text at new position
72+
73+
display.einkOn(); // Turn on e-ink display
74+
if (n > 9) // Check if you need to do full refresh or you can do partial update
75+
{
76+
display.einkOff(); // Turn off e-ink display after partial updates
77+
display.display(); // Do a full refresh
78+
n = 0;
79+
}
80+
else
81+
{
82+
display.partialUpdate(false, true); // Do partial update
83+
n++; // Keep track on how many times screen has been partially updated
84+
}
85+
offset -= 20; // Move text into new position
86+
if (offset < 0)
87+
offset = 1200; // Text is scrolled till the end of the screen? Get it back on the start!
88+
delay(500); // Delay between refreshes.
6389
}

examples/Inkplate5/Advanced_Inkplate_Features/Inkplate_Low_Power/Inkplate_Low_Power.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ void setup()
4949
if (slide > 2)
5050
slide = 0; // We do not have more than 3 images, so roll back to zero
5151

52-
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
52+
// Uncomment this line if your Inkplate is older than Aug 2021 as older Inkplates have ESP32 wrover-e chips
53+
// rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
54+
5355
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); // Activate wake-up timer -- wake up after 20s here
5456
esp_deep_sleep_start(); // Put ESP32 into deep sleep. Program stops here.
5557
}

examples/Inkplate5/Advanced_Inkplate_Features/Inkplate_Partial_Update_With_Deep_Sleep/Inkplate_Partial_Update_With_Deep_Sleep.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ void setup()
6464
}
6565
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP *
6666
uS_TO_S_FACTOR); // Set EPS32 to be woken up in 10 seconds (in this case)
67-
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
68-
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
67+
68+
// Uncomment this line if your Inkplate is older than Aug 2021 as older Inkplates have ESP32 wrover-e chips
69+
// rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
70+
71+
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
6972
}
7073

7174
void loop()

examples/Inkplate5/Basic_Inkplate_Functionality/Inkplate_Basic_Partial_Update/Inkplate_Basic_Partial_Update.ino

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void setup()
4343

4444
void loop()
4545
{
46+
// BASIC USAGE
47+
4648
display.clearDisplay(); // Clear content in frame buffer
4749
display.setCursor(offset, 300); // Set new position for text
4850
display.print(text); // Write text at new position
@@ -60,4 +62,28 @@ void loop()
6062
if (offset < 0)
6163
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
6264
delay(500); // Delay between refreshes.
65+
66+
67+
// ADVANCED USAGE
68+
69+
display.clearDisplay(); // Clear content in frame buffer
70+
display.setCursor(offset, 300); // Set new position for text
71+
display.print(text); // Write text at new position
72+
73+
display.einkOn(); // Turn on e-ink display
74+
if (n > 9) // Check if you need to do full refresh or you can do partial update
75+
{
76+
display.einkOff(); // Turn off e-ink display after partial updates
77+
display.display(); // Do a full refresh
78+
n = 0;
79+
}
80+
else
81+
{
82+
display.partialUpdate(false, true); // Do partial update
83+
n++; // Keep track on how many times screen has been partially updated
84+
}
85+
offset -= 20; // Move text into new position
86+
if (offset < 0)
87+
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
88+
delay(500); // Delay between refreshes.
6389
}

examples/Inkplate6/Advanced_Inkplate_Features/Inkplate_Partial_Update_With_Deep_Sleep/Inkplate_Partial_Update_With_Deep_Sleep.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ void setup()
6464
}
6565
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP *
6666
uS_TO_S_FACTOR); // Set EPS32 to be woken up in 10 seconds (in this case)
67-
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
68-
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
67+
68+
// Uncomment this line if your Inkplate is older than Aug 2021 as older Inkplates have ESP32 wrover-e chips
69+
// rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
70+
71+
esp_deep_sleep_start(); // Put ESP32 into deep sleep (low power mode)
6972
}
7073

7174
void loop()

examples/Inkplate6/Basic_Inkplate_Functionality/Inkplate_Basic_Partial_Update/Inkplate_Basic_Partial_Update.ino

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void setup()
4343

4444
void loop()
4545
{
46+
// BASIC USAGE
47+
4648
display.clearDisplay(); // Clear content in frame buffer
4749
display.setCursor(offset, 300); // Set new position for text
4850
display.print(text); // Write text at new position
@@ -53,8 +55,32 @@ void loop()
5355
}
5456
else
5557
{
56-
display.partialUpdate(); // Do partial update
57-
n++; // Keep track on how many times screen has been partially updated
58+
display.partialUpdate(false, true); // Do partial update
59+
n++; // Keep track on how many times screen has been partially updated
60+
}
61+
offset -= 20; // Move text into new position
62+
if (offset < 0)
63+
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
64+
delay(500); // Delay between refreshes.
65+
66+
67+
// ADVANCED USAGE
68+
69+
display.clearDisplay(); // Clear content in frame buffer
70+
display.setCursor(offset, 300); // Set new position for text
71+
display.print(text); // Write text at new position
72+
73+
display.einkOn(); // Turn on e-ink display
74+
if (n > 9) // Check if you need to do full refresh or you can do partial update
75+
{
76+
display.einkOff(); // Turn off e-ink display after partial updates
77+
display.display(); // Do a full refresh
78+
n = 0;
79+
}
80+
else
81+
{
82+
display.partialUpdate(false, true); // Do partial update
83+
n++; // Keep track on how many times screen has been partially updated
5884
}
5985
offset -= 20; // Move text into new position
6086
if (offset < 0)

examples/Inkplate6PLUS/Advanced_Inkplate_Features/Inkplate_Low_Power/Inkplate_Low_Power.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +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)
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+
4348
display.clearDisplay(); // Clear frame buffer of display
4449
display.drawImage(
4550
pictures[slide], 0, 43, 1024,
@@ -50,6 +55,10 @@ void setup()
5055
if (slide > 2)
5156
slide = 0; // We do not have more than 3 images, so roll back to zero
5257

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+
5362
rtc_gpio_isolate(GPIO_NUM_12); // Isolate/disable GPIO12 on ESP32 (only to reduce power consumption in sleep)
5463
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); // Activate wake-up timer -- wake up after 20s here
5564
esp_deep_sleep_start(); // Put ESP32 into deep sleep. Program stops here.

0 commit comments

Comments
 (0)