Overwrite with "printf" command
-
I'm trying to put on the lcd a number with the command "printf", but the screen writes the number over the previous one, so the result is a colored square in a short time.
I attach the code I'm using in case anyone can help me, thanks in advance.#include <M5Stack.h>
…….
double tiempoSegundos= 0;
void Printseg() // Presenta los seg en pantalla
{
M5.lcd.setCursor(0,180);
M5.Lcd.printf(" %6.3f",tiempoSegundos );
}
void setup() {
M5.begin(); // inicio del M5S:…..
void loop() {
……
Printseg(); } -
1 clear whole screen before print (possible flicker screen)
2 print same text on the same position with background color
3 draw filled rectangle with background color that cover area where text was printed -
Yes, correct I used the " M5.Lcd.setTextColor (YELLOW, BLACK);" in the setup command , and effectively overwriting by deleting the above. Thank you.
Greetings.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login