🤖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

    Scheduled Pinned Locked Moved FAQS
    3 Posts 2 Posters 7.8k Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post