Skip to content

Commit 4835be9

Browse files
committed
Merge branch 'dev'
2 parents e03afda + 1fc459c commit 4835be9

File tree

32 files changed

+1785
-76
lines changed

32 files changed

+1785
-76
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
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
Inkplate_Faster_Display example for e-radionica.com Inkplate 6
3+
For this example you will need a micro USB cable and an Inkplate 6
4+
Select "Inkplate 6(ESP32)" from Tools -> Board menu.
5+
Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
6+
https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
7+
8+
We can display and partial update our screens faster by leaving the panel power on.
9+
Just be sure to turn it off when going to deep sleep to save power.
10+
11+
Want to learn more about Inkplate? Visit www.inkplate.io
12+
Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
13+
22 September 2021 by e-radionica.com
14+
*/
15+
16+
#include "Inkplate.h"
17+
18+
// You can test it out in 3 bit mode too, by changing to INKPLATE_3BIT
19+
// beware it doesn't support partialUpdate yet
20+
Inkplate display(INKPLATE_1BIT);
21+
22+
void setup()
23+
{
24+
// Initialize the display and serial
25+
Serial.begin(115200);
26+
display.begin();
27+
}
28+
29+
void loop()
30+
{
31+
// TESTING Displaying standardly using display.display()
32+
uint32_t t;
33+
34+
display.fillCircle(100, 100, 50, BLACK);
35+
36+
t = millis();
37+
display.display();
38+
t = millis() - t;
39+
40+
Serial.print("display.display() took ");
41+
Serial.print(t);
42+
Serial.println(" ms");
43+
44+
display.clearDisplay();
45+
46+
// TESTING Displaying using display.display(1), where 1 is leaveOn flag
47+
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
48+
// and is assumed to be on already.
49+
50+
display.einkOn();
51+
52+
display.fillCircle(200, 100, 50, BLACK);
53+
54+
t = millis();
55+
display.display(1);
56+
t = millis() - t;
57+
58+
Serial.print("display.display(1) took ");
59+
Serial.print(t);
60+
Serial.println(" ms");
61+
62+
display.einkOff();
63+
64+
display.clearDisplay();
65+
66+
// TESTING Displaying using display.partialUpdate() as usual
67+
68+
display.fillCircle(300, 100, 50, BLACK);
69+
70+
t = millis();
71+
display.partialUpdate();
72+
t = millis() - t;
73+
74+
Serial.print("display.partialUpdate() took ");
75+
Serial.print(t);
76+
Serial.println(" ms");
77+
78+
display.clearDisplay();
79+
80+
// TESTING Displaying using display.partialUpdate(1), where 1 is leaveOn flag
81+
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
82+
// and is assumed to be on already, as with display.display's leaveOn flag.
83+
84+
display.einkOn();
85+
86+
display.fillCircle(400, 100, 50, BLACK);
87+
88+
t = millis();
89+
display.partialUpdate(0, 1);
90+
t = millis() - t;
91+
92+
Serial.print("display.partialUpdate(0, 1) took ");
93+
Serial.print(t);
94+
Serial.println(" ms");
95+
96+
display.einkOff();
97+
98+
display.clearDisplay();
99+
100+
Serial.println();
101+
Serial.println();
102+
103+
delay(5000);
104+
}

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
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
Inkplate_Faster_Display example for e-radionica.com Inkplate 6
3+
For this example you will need a micro USB cable and an Inkplate 6
4+
Select "Inkplate 6(ESP32)" from Tools -> Board menu.
5+
Don't have "Inkplate 6(ESP32)" option? Follow our tutorial and add it:
6+
https://e-radionica.com/en/blog/add-inkplate-6-to-arduino-ide/
7+
8+
We can display and partial update our screens faster by leaving the panel power on.
9+
Just be sure to turn it off when going to deep sleep to save power.
10+
11+
Want to learn more about Inkplate? Visit www.inkplate.io
12+
Looking to get support? Write on our forums: http://forum.e-radionica.com/en/
13+
22 September 2021 by e-radionica.com
14+
*/
15+
16+
#include "Inkplate.h"
17+
18+
// You can test it out in 3 bit mode too, by changing to INKPLATE_3BIT
19+
// beware it doesn't support partialUpdate yet
20+
Inkplate display(INKPLATE_1BIT);
21+
22+
void setup()
23+
{
24+
// Initialize the display and serial
25+
Serial.begin(115200);
26+
display.begin();
27+
}
28+
29+
void loop()
30+
{
31+
// TESTING Displaying standardly using display.display()
32+
uint32_t t;
33+
34+
display.fillCircle(100, 100, 50, BLACK);
35+
36+
t = millis();
37+
display.display();
38+
t = millis() - t;
39+
40+
Serial.print("display.display() took ");
41+
Serial.print(t);
42+
Serial.println(" ms");
43+
44+
display.clearDisplay();
45+
46+
// TESTING Displaying using display.display(1), where 1 is leaveOn flag
47+
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
48+
// and is assumed to be on already.
49+
50+
display.einkOn();
51+
52+
display.fillCircle(200, 100, 50, BLACK);
53+
54+
t = millis();
55+
display.display(1);
56+
t = millis() - t;
57+
58+
Serial.print("display.display(1) took ");
59+
Serial.print(t);
60+
Serial.println(" ms");
61+
62+
display.einkOff();
63+
64+
display.clearDisplay();
65+
66+
// TESTING Displaying using display.partialUpdate() as usual
67+
68+
display.fillCircle(300, 100, 50, BLACK);
69+
70+
t = millis();
71+
display.partialUpdate();
72+
t = millis() - t;
73+
74+
Serial.print("display.partialUpdate() took ");
75+
Serial.print(t);
76+
Serial.println(" ms");
77+
78+
display.clearDisplay();
79+
80+
// TESTING Displaying using display.partialUpdate(1), where 1 is leaveOn flag
81+
// by setting leaveOn to 1 screens power supply won't be turned off at the end,
82+
// and is assumed to be on already, as with display.display's leaveOn flag.
83+
84+
display.einkOn();
85+
86+
display.fillCircle(400, 100, 50, BLACK);
87+
88+
t = millis();
89+
display.partialUpdate(0, 1);
90+
t = millis() - t;
91+
92+
Serial.print("display.partialUpdate(0, 1) took ");
93+
Serial.print(t);
94+
Serial.println(" ms");
95+
96+
display.einkOff();
97+
98+
display.clearDisplay();
99+
100+
Serial.println();
101+
Serial.println();
102+
103+
delay(5000);
104+
}

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
}

0 commit comments

Comments
 (0)