Skip to content

Commit 7e687bb

Browse files
committed
Added testing example for leaveOn
1 parent 3236d4e commit 7e687bb

File tree

4 files changed

+416
-0
lines changed

4 files changed

+416
-0
lines changed
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+
}
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+
}
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+
}

0 commit comments

Comments
 (0)