Skip to content

Commit 706ab0e

Browse files
committed
Add Inkplate2 Peripheral Mode command setTextColor
Fixes SolderedElectronics#266 Without setting text color first, displayed text will be invisible. Add setTextColor to Peripheral Mode to be able to set text color. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/SolderedElectronics/Inkplate-Arduino-library/issues/266?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 2dd263f commit 706ab0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void loop()
7171
{
7272
if ((e - s) > 0)
7373
{
74-
int x, x1, x2, y, y1, y2, x3, y3, l, c, w, h, r, n, rx, ry, xc, yc;
74+
int x, x1, x2, y, y1, y2, x3, y3, l, c, w, h, r, n, rx, ry, xc, yc, fgColor, bgColor;
7575
char b;
7676
char temp[150];
7777
switch (*(s + 1))
@@ -196,6 +196,11 @@ void loop()
196196
display.setRotation(c);
197197
break;
198198

199+
case 'H':
200+
// Set text and background color
201+
sscanf(s + 3, "%d,%d", &fgColor, &bgColor);
202+
display.setTextColor(fgColor, bgColor);
203+
break;
199204

200205
case 'K':
201206
// Clear the display (frame buffer only)

0 commit comments

Comments
 (0)