-
|
Hi, I'm really impressed with this software, it works well. I'm using it for a clock/calendar display spread over 2 x 64 x 32 panels. I hopefully have a simple question. If I write a text string to the panel using 'dma_display->print(text[color])' it simply overwrites any text that was already displayed, e.g. updating hours, minutes, seconds etc.. I tried simply writing a space character, but the software appears to only change illuminated pixels, it doesn't extinguish those not needed. Is there a simple way to clear previous text before writing new, or do I need to do something like drawing a black filled rectangle first to blank out the old text ? PM |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I think this is easiest way to clear the text. |
Beta Was this translation helpful? Give feedback.
-
|
print a "background" (color) text before the new, or check if the second is the same of the "second" before; if diffferent, print new value |
Beta Was this translation helpful? Give feedback.
-
|
Solved this one, character code 218 is a full block, write in black and it removes any previous characters. Code snippet that works with the colorwheel example - `// write character array 'text' to dislay at xpos, ypos dma_display->setCursor(xpos, ypos); // set cursor position |
Beta Was this translation helpful? Give feedback.
Solved this one, character code 218 is a full block, write in black and it removes any previous characters.
Code snippet that works with the colorwheel example -
`// write character array 'text' to dislay at xpos, ypos
// clears characters before writing
dma_display->setCursor(xpos, ypos); // set cursor position
dma_display->setTextColor(myBLACK); // change colour to black
for (uint8_t x = 0; x < strlen(text); x++)
{
dma_display->print((char)218); // write black block to display
}
dma_display->setCursor(xpos, ypos); // set cursor position again
for (uint8_t x = 0; x < strlen(text); x++)
{ // draw characters using colorWheel
dma_display->setTextColor(colorWheel((color*32)+offset));
dma_dis…