lcd16x2print

ivanmason/lcd16x2x5button/lcd16x2print

No description
lcd16x2print
@/lcd16x2print
DEV@/lcd16x2
Lcd Objected
TEXTstring
Text To Write To LCD
Cxnumber
Cursor Position X 0 to 16
Cynumber
Cursor Position Y 0 or 1
UPDpulse
Trigger to Output Text
lcd16x2print
DEV
TEXT
Cx
Cy
UPD
DEV'
DONE
DONEpulse
Trigger When Done
DEV'@/lcd16x2
Lcd Objected
To use the node in your project you should have the ivanmason/lcd16x2x5button 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) {

    emitValue<output_DEVU0027>(ctx, getValue<input_DEV>(ctx));
    
    if (isInputDirty<input_UPD>(ctx)){
        auto lcd = getValue<input_DEV>(ctx);
        
        auto text = getValue<input_TEXT>(ctx);
                
        lcd->setCursor(getValue<input_Cx>(ctx), getValue<input_Cy>(ctx));
        uint8_t whitespace = 16;
        for (auto it = text.iterate(); it; ++it, --whitespace)
        lcd->write(*it);

        // Clear the rest of the line
        while (whitespace--)
            lcd->write(' ');
        
        emitValue<output_DONE>(ctx, 1); 
    }
}