Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. JonnyMac
    J
    • Continue chat with JonnyMac
    • Start new chat with JonnyMac
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    JonnyMac

    @JonnyMac

    0
    Reputation
    1
    Posts
    630
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    JonnyMac Follow

    Posts made by JonnyMac

    • How To Overwrite Text Without Flash?

      I'm working on a timer application. It runs fine, but when the timer updates there is a distinct (and bothersome) flash. It's as if the process fills the space used by the text with the background color, and then writes the text on top of that. This is the code fragment.

      void display_mmss(uint8_t mm, uint8_t ss, uint16_t fc, uint16_t bc)
      {
      char timeStr[6] = {'0', '0', ':', '0', '0', '\0'};

      timeStr[0] = char('0' + (mm / 10));
      timeStr[1] = char('0' + (mm % 10));
      timeStr[3] = char('0' + (ss / 10));
      timeStr[4] = char('0' + (ss % 10));

      m5.lcd.setTextColor(fc, bc);
      m5.lcd.setTextDatum(CC_DATUM);
      m5.lcd.setFreeFont(&Digital7Mono65pt7b);
      m5.lcd.drawString(timeStr, 160, 120);
      }

      (My code is properly indented -- this forum doesn't seem to allow for that)

      posted in Arduino
      J
      JonnyMac