Adding Text to screen button causes any subsequent screen text writes to corrupt screen
-
I'm using an M5Stack Core2 AWS on a project where I need to use on-screen buttons:
Button BtnL(10, 190, 60, 40, false, "Dec", off_clrs, on_clrs, TL_DATUM); //and: BtnL.setLabel("Dec");
I have found that anytime I put any text into the button, the screen after the button is displayed (such as):
M5.Lcd.print(Line2.c_str()); // or M5.Lcd.print(Line2);
the screen is corrupted and the only way that I have found to correct the problem is to reboot the Core2 device.
The corrupted screen looks like:
The only way I've found to use the on-screen buttons is to leave the button text blank and write the text above the screen button.
This very much appears to be a bug in the code.
Should I write this up as a bug on https://github.com/m5stack/M5Core2/issues/ ?Sir Michael
-
Hello @SirMichael
there is a mechanism trying to deal with this issue. Please see here.
That said, it did not work for me. What works is to set the relevant parameters every time before printing to the screen like below:
M5.Lcd.setCursor(0, 10); M5.Lcd.setTextFont(2); M5.Lcd.setTextColor(TFT_YELLOW); M5.Lcd.print("hallo 2");
Thanks
FelixP.S.: M5Core2 library is deprecated and I haven't seen the person who wrote the library in the forums in a long time.