Has anyone figured out a good way to update the display quickly?
-
I have my display showing a constantly updating number, but this number doesn't ever get erased which makes it really hard to read after a short while.
I tried setting the whole display to black before doing each number but it creates a rolling effect... -
@joeybab3 Hi Joey,
This twitter user seems to have it working.......
https://twitter.com/ksasao/status/970196248836755456 -
Personally, I have been experimenting only with smaller fonts and multiple lines of text of which only one line requires updating. If this is the case, I first clear the dynamic line with
\r
and then write the updated string. This happens much quicker than clearing all pixels of the screen.Having said that, I am surprised that I cannot reliably clock the ILI9341TFT driver chip at speeds higher than 2.6MHz, whereas the spec sheet states that clock speeds up to 10MHz should be supported. Many outside the M5Stack scene even successfully overclocked this chip in many instances.
So, I am really wondering whether the M5Stack contains a genuine ILI9341, or is it the TFT screen itself which is really slow or what else could be wrong?
-
@on4aa 在 Has anyone figured out a good way to update the display quickly? 中说:
If this is the case, I first clear the dynamic line with
\r
and then write the updated string. This happens much quicker than clearing all pixels of the screen.@on4aa, Can you please provide example code of the above?
I have been experimenting with text quite a bit as well. I first was drawing a rectangle the same color as the background approximately the same size as the text, before writing the line of text. But I think this would have the same rolling effect as @joeybab3 was saying under fast update situations.
@joeybab3, another suggestion is to provide the background color while defining the text color. Did you try that?
M5.Lcd.setTextColor(TFT_BLACK,TFT_WHITE);
I have not tested this in a fast update scenario, but from the twitter video above, it looks like what he did.
-
I agree with you. the fast(er) update is done with
M5.Lcd.setTextColor(TFT_BLACK,TFT_WHITE);
-
Yep, or any combination of these defined colors
TFT_BLACK
TFT_NAVY
TFT_DARKGREEN
TFT_DARKCYAN
TFT_MAROON
TFT_PURPLE
TFT_OLIVE
TFT_LIGHTGREY
TFT_DARKGREY
TFT_BLUE
TFT_GREEN
TFT_CYAN
TFT_RED
TFT_MAGENTA
TFT_YELLOW
TFT_WHITE
TFT_ORANGE
TFT_GREENYELLOW
TFT_PINKOr you can define your own color based on red, green, and blue values, like this:
#define MY_CUSTOM_COLOR M5.Lcd.color565(83,54,120) /* uint16_t color565(uint8_t r, uint8_t g, uint8_t b), */
-
nice tip on the custom color didnt know that
-
--
The code for the counter pictured above has kindly been made available by the author at the following link:
https://gist.github.com/ksasao/c67d6fff5641e6fd40c7705352f6759eA required file M5Stackupdater.h is available here: https://github.com/tobozo/M5Stack-SD-Updater/tree/master/src
--
There is also a timer app in the SAM menu program available here:
https://github.com/PartsandCircuits/M5Stack-SAM--
And a list of programming functions here:
https://github.com/PartsandCircuits/M5CheatSheet** Should add that color command listed above.