tftprint

ivanmason/tft-lcd-touch/tftprint

No description
tftprint
@/tftprint
DEV@/tftlcd-device
SIZEnumber
CXnumber
CYnumber
COLnumber
MSGstring
UPDpulse
tftprint
DONE
DEV
SIZE
CX
CY
COL
MSG
UPD
DONEpulse
To use the node in your project you should have the ivanmason/tft-lcd-touch 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_UPD>(ctx))
        return;
   
    auto tft = getValue<input_DEV>(ctx);
    auto cx = getValue<input_CX>(ctx);
    auto cy = getValue<input_CY>(ctx);
    auto size = getValue<input_SIZE>(ctx);
    auto colour = getValue<input_COL>(ctx);
    auto TXT = getValue<input_MSG>(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(cx, cy); 
    tft->setTextColor(colour,0); 
    tft->setTextSize(size); 
    tft->print(TXTC);
    
    emitValue<output_DONE>(ctx, 1);
}