ridercz / Altairis-ESP8266-FC16

Library for using the FC-16 display module (based od MAX72xx) with ESP8266 (NodeMCU)
MIT License
21 stars 3 forks source link

Using a variable for the displayed text #2

Closed DuncanAmos closed 6 years ago

DuncanAmos commented 7 years ago

Works great but I need to use a variable for the text to be displayed (it will depend on various parameters and will be a concatenated string).

It won't seem to allow me to do it. As a test, I'm using this within the loop: String countString = String(showCount); String outString = ("Pass through loop number " + countString); display.setText(outString);

It throws this error: exit status 1 no matching function for call to 'FC16::setText(String&)'

ridercz commented 6 years ago

This should work: display.setText(outString.c_str());

cmorda commented 5 years ago

That did not work for me. adding this to convert the string to char worked in my case:

char message[payload.length()]; payload.toCharArray(message, payload.length());

Maybe this will help someone.