Sending MQTT data to the LCD



  • 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



  • 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 ?



  • 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.