Skip to content

Commit 8bb93d6

Browse files
Feedback fix
1 parent 5d0ef1e commit 8bb93d6

File tree

7 files changed

+115
-124
lines changed

7 files changed

+115
-124
lines changed

examples/Inkplate10/Basic/Inkplate10_Partial_Update/Inkplate10_Partial_Update.ino

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const char text[] = "This is partial update on Inkplate 10 e-paper display! :)";
2929
// This variable is used for moving the text (scrolling)
3030
int offset = 1200;
3131

32+
//This variable is used to define the number of partial updates before doing a full update
3233
int partialUpdates=9;
3334

3435
void setup()
@@ -39,31 +40,31 @@ void setup()
3940
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
4041
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4142
display.setTextWrap(false); // Disable text wraping
42-
display.setFullUpdateThreshold(partialUpdates); //Set the number of partial updates before doing a full update
43+
/*
44+
Set the number of partial updates before doing a full update
45+
This function forces a full update as the next update to ensure that the cycle of partial
46+
updates starts from a fully updated screen.
47+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
48+
*/
49+
display.setFullUpdateThreshold(partialUpdates);
4350
}
4451

4552
void loop()
4653
{
47-
// BASIC USAGE
48-
4954
display.clearDisplay(); // Clear content in frame buffer
5055
display.setCursor(offset, 300); // Set new position for text
5156
display.print(text); // Write text at new position
52-
display.partialUpdate(false, true); // Do partial update
53-
offset -= 20; // Move text into new position
54-
if (offset < 0)
55-
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
56-
delay(500); // Delay between refreshes.
5757

58-
// ADVANCED USAGE
59-
60-
display.clearDisplay(); // Clear content in frame buffer
61-
display.setCursor(offset, 300); // Set new position for text
62-
display.print(text); // Write text at new position
63-
display.einkOn(); // Turn on e-ink display
64-
display.partialUpdate(false, true); // Do partial update
58+
/*
59+
//Updates changes parts of the screen without the need to refresh the whole display
60+
//partialUpdate(bool _forced, bool leaveOn)
61+
_forced Can force partial update in deep sleep (for advanced use)
62+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
63+
*/
64+
display.partialUpdate(false, true);
6565
offset -= 20; // Move text into new position
6666
if (offset < 0)
6767
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
6868
delay(500); // Delay between refreshes.
69+
6970
}

examples/Inkplate4TEMPERA/Basic/Inkplate4TEMPERA_Partial_Update/Inkplate4TEMPERA_Partial_Update.ino

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,61 +30,41 @@ const char text[] = "This is partial update on Inkplate 4TEMPERA e-paper display
3030
// creating a scrolling effect as it decreases.
3131
int offset = 600;
3232

33-
// Variable that keeps count on how how many times the screen has been partially updated
34-
int n = 0;
33+
//This variable is used to define the number of partial updates before doing a full update
34+
int partialUpdates=9;
3535

3636
void setup()
3737
{
3838
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
3939
display.clearDisplay(); // Clear frame buffer of display
4040
display.display(); // Put clear image on display
4141
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
42-
display.setTextSize(3); // Set text to be 3 times bigger than classic 5x7 px text
42+
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4343
display.setTextWrap(false); // Disable text wraping
44+
/*
45+
Set the number of partial updates before doing a full update
46+
This function forces a full update as the next update to ensure that the cycle of partial
47+
updates starts from a fully updated screen.
48+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
49+
*/
50+
display.setFullUpdateThreshold(partialUpdates);
4451
}
4552

4653
void loop()
4754
{
48-
// BASIC USAGE
49-
50-
display.clearDisplay(); // Clear content in frame buffer
51-
display.setCursor(offset, 300); // Set new position for text
52-
display.print(text); // Write text at new position
53-
if (n > 9)
54-
{ // Check if you need to do full refresh or you can do partial update
55-
display.display(); // Do a full refresh
56-
n = 0;
57-
}
58-
else
59-
{
60-
display.partialUpdate(false, true); // Do partial update
61-
n++; // Keep track on how many times screen has been partially updated
62-
}
63-
offset -= 20; // Move text into new position
64-
if (offset < -1100) // Offset is negative so the entire text scrolls past the screen until it's not visible
65-
offset = 600; // Text is scrolled fully? Go back to the start
66-
delay(500); // Delay between refreshes.
67-
68-
// ADVANCED USAGE
69-
7055
display.clearDisplay(); // Clear content in frame buffer
7156
display.setCursor(offset, 300); // Set new position for text
7257
display.print(text); // Write text at new position
7358

74-
display.einkOn(); // Turn on e-ink display
75-
if (n > 9) // Check if you need to do full refresh or you can do partial update
76-
{
77-
display.einkOff(); // Turn off e-ink display after partial updates
78-
display.display(); // Do a full refresh
79-
n = 0;
80-
}
81-
else
82-
{
83-
display.partialUpdate(false, true); // Do partial update
84-
n++; // Keep track on how many times screen has been partially updated
85-
}
59+
/*
60+
//Updates changes parts of the screen without the need to refresh the whole display
61+
//partialUpdate(bool _forced, bool leaveOn)
62+
_forced Can force partial update in deep sleep (for advanced use)
63+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
64+
*/
65+
display.partialUpdate(false, true);
8666
offset -= 20; // Move text into new position
87-
if (offset < -1100) // Offset is negative so the entire text scrolls past the screen until it's not visible
88-
offset = 600; // Text is scrolled fully? Go back to the start
67+
if (offset < 0)
68+
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
8969
delay(500); // Delay between refreshes.
90-
}
70+

examples/Inkplate5/Basic/Inkplate5_Partial_Update/Inkplate5_Partial_Update.ino

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const char text[] = "This is partial update on Inkplate 5 e-paper display! :)";
2929
// This variable is used for moving the text (scrolling)
3030
int offset = E_INK_WIDTH;
3131

32+
//This variable is used to define the number of partial updates before doing a full update
3233
int partialUpdates=9;
3334

3435
void setup()
@@ -39,8 +40,13 @@ void setup()
3940
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
4041
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4142
display.setTextWrap(false); // Disable text wraping
42-
display.setFullUpdateThreshold(partialUpdates); //Set the number of partial updates before doing a full update
43-
43+
/*
44+
Set the number of partial updates before doing a full update
45+
This function forces a full update as the next update to ensure that the cycle of partial
46+
updates starts from a fully updated screen.
47+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
48+
*/
49+
display.setFullUpdateThreshold(partialUpdates);
4450
}
4551

4652
void loop()
@@ -50,21 +56,16 @@ void loop()
5056
display.clearDisplay(); // Clear content in frame buffer
5157
display.setCursor(offset, 300); // Set new position for text
5258
display.print(text); // Write text at new position
53-
display.partialUpdate(false, true); // Do partial update
59+
/*
60+
//Updates changes parts of the screen without the need to refresh the whole display
61+
//partialUpdate(bool _forced, bool leaveOn)
62+
_forced Can force partial update in deep sleep (for advanced use)
63+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
64+
*/
65+
display.partialUpdate(false, true);
5466
offset -= 20; // Move text into new position
5567
if (offset < 0)
5668
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
5769
delay(500); // Delay between refreshes.
5870

59-
// ADVANCED USAGE
60-
61-
display.clearDisplay(); // Clear content in frame buffer
62-
display.setCursor(offset, 300); // Set new position for text
63-
display.print(text); // Write text at new position
64-
display.einkOn(); // Turn on e-ink display
65-
display.partialUpdate(false, true); // Do partial update
66-
offset -= 20; // Move text into new position
67-
if (offset < 0)
68-
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
69-
delay(500); // Delay between refreshes.
7071
}

examples/Inkplate5V2/Basic/Inkplate5V2_Partial_Update/Inkplate5V2_Partial_Update.ino

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const char text[] = "This is partial update on Inkplate 5V2 e-paper display! :)"
2929
// This variable is used for moving the text (scrolling)
3030
int offset = E_INK_WIDTH;
3131

32+
//This variable is used to define the number of partial updates before doing a full update
3233
int partialUpdates=9;
3334

3435
void setup()
@@ -39,7 +40,13 @@ void setup()
3940
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
4041
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4142
display.setTextWrap(false); // Disable text wraping
42-
display.setFullUpdateThreshold(partialUpdates); //Set the number of partial updates before doing a full update
43+
/*
44+
Set the number of partial updates before doing a full update
45+
This function forces a full update as the next update to ensure that the cycle of partial
46+
updates starts from a fully updated screen.
47+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
48+
*/
49+
display.setFullUpdateThreshold(partialUpdates);
4350
}
4451

4552
void loop()
@@ -49,21 +56,17 @@ void loop()
4956
display.clearDisplay(); // Clear content in frame buffer
5057
display.setCursor(offset, 300); // Set new position for text
5158
display.print(text); // Write text at new position
52-
display.partialUpdate(false, true); // Do partial update
53-
offset -= 20; // Move text into new position
54-
if (offset < 0)
55-
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
56-
delay(500); // Delay between refreshes.
57-
58-
// ADVANCED USAGE
5959

60-
display.clearDisplay(); // Clear content in frame buffer
61-
display.setCursor(offset, 300); // Set new position for text
62-
display.print(text); // Write text at new position
63-
display.einkOn(); // Turn on e-ink display
64-
display.partialUpdate(false, true); // Do partial update
60+
/*
61+
//Updates changes parts of the screen without the need to refresh the whole display
62+
//partialUpdate(bool _forced, bool leaveOn)
63+
_forced Can force partial update in deep sleep (for advanced use)
64+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
65+
*/
66+
display.partialUpdate(false, true);
6567
offset -= 20; // Move text into new position
6668
if (offset < 0)
6769
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
6870
delay(500); // Delay between refreshes.
71+
6972
}

examples/Inkplate6/Basic/Inkplate6_Partial_Update/Inkplate6_Partial_Update.ino

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const char text[] = "This is partial update on Inkplate 6 e-paper display! :)";
2929
// This variable is used for moving the text (scrolling)
3030
int offset = 800;
3131

32+
//This variable is used to define the number of partial updates before doing a full update
3233
int partialUpdates=9;
34+
3335
void setup()
3436
{
3537
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
@@ -38,7 +40,13 @@ void setup()
3840
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
3941
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4042
display.setTextWrap(false); // Disable text wraping
41-
display.setFullUpdateThreshold(partialUpdates); //Set the number of partial updates before doing a full update
43+
/*
44+
Set the number of partial updates before doing a full update
45+
This function forces a full update as the next update to ensure that the cycle of partial
46+
updates starts from a fully updated screen.
47+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
48+
*/
49+
display.setFullUpdateThreshold(partialUpdates);
4250
}
4351

4452
void loop()
@@ -48,21 +56,16 @@ void loop()
4856
display.clearDisplay(); // Clear content in frame buffer
4957
display.setCursor(offset, 300); // Set new position for text
5058
display.print(text); // Write text at new position
51-
display.partialUpdate(false, true); // Do partial update
59+
/*
60+
//Updates changes parts of the screen without the need to refresh the whole display
61+
//partialUpdate(bool _forced, bool leaveOn)
62+
_forced Can force partial update in deep sleep (for advanced use)
63+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
64+
*/
65+
display.partialUpdate(false, true);
5266
offset -= 20; // Move text into new position
5367
if (offset < 0)
5468
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
5569
delay(500); // Delay between refreshes.
5670

57-
// ADVANCED USAGE
58-
59-
display.clearDisplay(); // Clear content in frame buffer
60-
display.setCursor(offset, 300); // Set new position for text
61-
display.print(text); // Write text at new position
62-
display.einkOn(); // Turn on e-ink display
63-
display.partialUpdate(false, true); // Do partial update
64-
offset -= 20; // Move text into new position
65-
if (offset < 0)
66-
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
67-
delay(500); // Delay between refreshes.
6871
}

examples/Inkplate6FLICK/Basic/Inkplate6FLICK_Partial_Update/Inkplate6FLICK_Partial_Update.ino

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const char text[] = "This is partial update on Inkplate 6FLICK e-paper display!
2929
// This variable is used for moving the text (scrolling)
3030
int offset = 800;
3131

32+
//This variable is used to define the number of partial updates before doing a full update
3233
int partialUpdates=9;
3334

34-
3535
void setup()
3636
{
3737
display.begin(); // Init Inkplate library (you should call this function ONLY ONCE)
@@ -40,8 +40,13 @@ void setup()
4040
display.setTextColor(BLACK, WHITE); // Set text color to be black and background color to be white
4141
display.setTextSize(4); // Set text to be 4 times bigger than classic 5x7 px text
4242
display.setTextWrap(false); // Disable text wraping
43-
display.setFullUpdateThreshold(partialUpdates); //Set the number of partial updates before doing a full update
44-
43+
/*
44+
Set the number of partial updates before doing a full update
45+
This function forces a full update as the next update to ensure that the cycle of partial
46+
updates starts from a fully updated screen.
47+
The Inkplate class keeps a internal counter that increments every time partialUpdate() gets called.
48+
*/
49+
display.setFullUpdateThreshold(partialUpdates);
4550
}
4651

4752
void loop()
@@ -51,21 +56,17 @@ void loop()
5156
display.clearDisplay(); // Clear content in frame buffer
5257
display.setCursor(offset, 300); // Set new position for text
5358
display.print(text); // Write text at new position
54-
display.partialUpdate(false, true); // Do partial update
59+
60+
/*
61+
//Updates changes parts of the screen without the need to refresh the whole display
62+
//partialUpdate(bool _forced, bool leaveOn)
63+
_forced Can force partial update in deep sleep (for advanced use)
64+
leaveOn If set to 1, it will disable turning power supply for eink after display update in order to increase refresh time
65+
*/
66+
display.partialUpdate(false, true);
5567
offset -= 20; // Move text into new position
5668
if (offset < 0)
5769
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
5870
delay(500); // Delay between refreshes.
5971

60-
// ADVANCED USAGE
61-
62-
display.clearDisplay(); // Clear content in frame buffer
63-
display.setCursor(offset, 300); // Set new position for text
64-
display.print(text); // Write text at new position
65-
display.einkOn(); // Turn on e-ink display
66-
display.partialUpdate(false, true); // Do partial update
67-
offset -= 20; // Move text into new position
68-
if (offset < 0)
69-
offset = 800; // Text is scrolled till the end of the screen? Get it back on the start!
70-
delay(500); // Delay between refreshes.
7172
}

0 commit comments

Comments
 (0)