🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5.Lcd.printf writes over previous print

    General
    1
    1
    3.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mikemoy
      last edited by

      I wanted to do something I thought was simple.

            M5.Lcd.setTextSize(2);
            M5.Lcd.setTextColor(ORANGE);
      
            for(int x=0; x < 100;x++)
            {
              M5.lcd.setCursor(240,165);
              M5.Lcd.print(x);
            }
      

      Yet, when it prints to the LCD they just overlap to the point where its all just a blob. I have tried M5.Lcd.printf, M5.Lcd.print, M5.Lcd.drawNumber, and M5.Lcd.drawString and they all do the same thing.
      I.E. it does not clear the pixels to the background color that are not part of what being drawn.
      My next though was that i needed to use fillRect inbetween prints, but that seems like a waste of cpu time to do that.
      Would it not be better to have an extra option for all these to set non used pixels to a background color when it prints?
      I.E. drawString(const char *string, int32_t poX, int32_t poY, , uint16_t color);

      OR, is there another way that I am just not seeing.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post