Background Color (From Color block)
(Used for quick erase of previous TXT)
INITpulse
Pulse to update
OKpulse
Pulse on Complete
OUT@/tft-lcd-device
To use the node in your project you should have the bradzilla84/color-tft-lcd-driver-mcufriend-kbv library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_INIT>(ctx)){
emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
return;}
auto tft = getValue<input_IN>(ctx);
auto color = getValue<input_Color>(ctx);
auto bgcolor = getValue<input_BGColor>(ctx);
auto TXT = getValue<input_TXT>(ctx);
// `length` returns the number of characters and you need an extra one to keep the
// terminal NUL-character used in C string representation. Initialize to 0’s to ensure the last char is indeed NUL
char TXTC[length(TXT) + 1] = { 0 };
// move the data from XString to the plain C string
dump(TXT, TXTC);
tft->setCursor(getValue<input_X>(ctx), getValue<input_Y>(ctx));
tft->setTextColor(color.Hex, bgcolor.Hex);
tft->setTextSize(getValue<input_TXTSize>(ctx));
tft->println(TXTC);
emitValue<output_OUT>(ctx, getValue<input_IN>(ctx));
emitValue<output_OK>(ctx, 1);
}