i2c-custom-char-print-at

rsbabin/custom-characters/i2c-custom-char-print-at

No description
i2c-custom-char-print-at
@/i2c-custom-char-print-at
DEVxod-dev/text-lcd/text-lcd-i2c-device
ROWnumber
The row index on the display. Starts from 0.
POSnumber
Position in the row. Starts from 0.
numnumber
Custom character byte number (0-7)
DOpulse
Update the allocated area content
i2c-custom-char-print-at
DEV
ROW
POS
num
DO
DEV'
DONE
DONEpulse
Fires when the allocated area is updated
DEV'xod-dev/text-lcd/text-lcd-i2c-device
To use the node in your project you should have the rsbabin/custom-characters 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 printAt(LiquidCrystal_I2C* lcd, uint8_t rowIndex, uint8_t posIndex, Number charnum) {
    lcd->setCursor(posIndex, rowIndex);
    lcd->write(byte(charnum));

}

void evaluate(Context ctx) {
    auto t = getValue<input_DEV>(ctx);

   if (isInputDirty<input_DO>(ctx)) {
        uint8_t row = (uint8_t) getValue<input_ROW>(ctx);
        uint8_t pos = (uint8_t) getValue<input_POS>(ctx);
        Number charNum = getValue<input_num>(ctx);

        if (row < 0 || row >= t.rows || pos < 0 || pos >= t.cols) {
            raiseError<output_DONE>(ctx);
            return;
        }

        printAt(t.lcd, row, pos, charNum);
        emitValue<output_DONE>(ctx, 1);
        }

    emitValue<output_DEVU0027>(ctx, t);
  
}