hc595-getpin

bradzilla84/74hc595/hc595-getpin

No description
hc595-getpin
@/hc595-getpin
DEV@/hc595-device
Qxnumber
Pin Number (Pin Numbers start at 0... pin one is 0)
INITpulse
hc595-getpin
OUT
Qval
DONE
DEV
Qx
INIT
DONEpulse
Qvalboolean
OUT@/hc595-device
To use the node in your project you should have the bradzilla84/74hc595 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 {
};

// clang-format off
{{ GENERATED_CODE }}
// clang-format on

void evaluate(Context ctx) {
    if (!isInputDirty<input_INIT>(ctx)){
    emitValue<output_OUT>(ctx, getValue<input_DEV>(ctx));
        return;}
    auto pin = getValue<input_Qx>(ctx);
    auto sr = getValue<input_DEV>(ctx); // Get a pointer to the class instance

    emitValue<output_Qval>(ctx, (uint8_t)sr->get(pin));
    emitValue<output_DONE>(ctx, 1);

}