text-lcd-parallel-device

xod-dev/text-lcd/text-lcd-parallel-device

No description
text-lcd-parallel-device
@/text-lcd-parallel-device
RSport
Board GPIO port with LCD RS pin
ENport
Board GPIO port with LCD EN pin
D4port
Board GPIO port with LCD D4 pin
D5port
Board GPIO port with LCD D5 pin
D6port
Board GPIO port with LCD D6 pin
D7port
Board GPIO port with LCD D7 pin
COLSnumber
ROWSnumber
text-lcd-parallel-device
RS
EN
D4
D5
D6
D7
COLS
ROWS
DEV
DEV@/text-lcd-parallel-device
To use the node in your project you should have the xod-dev/text-lcd 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

#pragma XOD error_raise enable

#include <LiquidCrystal.h>

node {
    meta {
      struct Type {
          LiquidCrystal* lcd;
          uint8_t rows;
          uint8_t cols;
      };
    }

    static_assert(isValidDigitalPort(constant_input_RS), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_EN), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_D4), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_D5), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_D6), "must be a valid digital port");
    static_assert(isValidDigitalPort(constant_input_D7), "must be a valid digital port");

    LiquidCrystal lcd = LiquidCrystal(
      constant_input_RS,
      constant_input_EN,
      constant_input_D4,
      constant_input_D5,
      constant_input_D6,
      constant_input_D7
    );

    void evaluate(Context ctx) {
        uint8_t rows = (uint8_t) getValue<input_ROWS>(ctx);
        uint8_t cols = (uint8_t) getValue<input_COLS>(ctx);

        Type t;
        t.rows = rows;
        t.cols = cols;
        t.lcd = &lcd;
        t.lcd->begin(t.cols, t.rows);

        emitValue<output_DEV>(ctx, t);
    }
}