If you set the display text color then when you output text to the display in the same cursor location the display code does not clear the previous written text when overwriting the text. See below sample code an pictures.
#include "Arduino.h"
#include <M5Unified.h>
int counter1 = 0;
int counter2 = 209;
void setup() {
auto cfg = M5.config();
M5.begin(cfg);
delay(500);
M5.Display.clear();
delay(100);
}
void loop() {
M5.update();
M5.Display.setTextColor(TFT_GREEN); //--COMMENT OUT THIS LINE AND IT WILL WORK--
M5.Display.setCursor(0, 20);
M5.Display.print( "C1: ");
M5.Display.print( counter1);
M5.Display.setCursor(0, 30);
M5.Display.print( "C2: ");
M5.Display.print( counter2);
counter1++;
counter2++;
delay(100);
}
If you set the display text color then when you output text to the display in the same cursor location the display code does not clear the previous written text when overwriting the text. See below sample code an pictures.
Without color set
With color set