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

    Sending MQTT data to the LCD

    FAQS
    2
    3
    6.8k
    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.
    • G
      gadjet
      last edited by

      Hi,
      I'm using the M5 to display temp data from an MQTT server.
      All works OK but I'm using

      for (int i = 0; i < length; i++) {
      M5.Lcd.setFreeFont(FMB24);
      M5.Lcd.print((char)payload[i]);
      }

      To print to the screen, when I print a second value underneath it I had to remove a screen clear command so I could see both values, now the numbers are overwriting each other.

      I want to use Drawstring command as this adds a background which I assume will remove the previous numbers but I cannot get it to work with the char based payload, I've tried to convert it but cannot get it working.

      Has anyone used Pubsubclient and printed values to the screen using Drawstring?

      Cheers,
      Phil

      1 Reply Last reply Reply Quote 0
      • RopR
        Rop
        last edited by

        Whether a background color is printed depends on whether you supply one or two color values to m5.lcd.setTextColor, I think. Are you using M5ez? If so, try ez.print / ez.println ?

        1 Reply Last reply Reply Quote 0
        • G
          gadjet
          last edited by

          Hi,
          I'm not using M5ez yet but I will give it a try, I've set the background colour but I don't think it works with M5.Lcd.print commands.

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