count-v5

gb79126/webasto-v6/count-v5

No description
count-v5
@/count-v5
DECpulse
Triggers a single decrement.
STEPnumber
Value to add on each increment.
INCpulse
Triggers a single increment.
RSTpulse
Resets the accumulated value to zero.
count-v5
DEC
STEP
INC
RST
COUNT
COUNTnumber
The accumulated value.
To use the node in your project you should have the gb79126/webasto-v6 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) {
    Number count = getValue<output_OUT>(ctx);

    if (isInputDirty<input_RST>(ctx))
        count = 0;
    else {
        auto step = getValue<input_STEP>(ctx);

        if (isInputDirty<input_INC>(ctx))
            count += step;

        if (isInputDirty<input_DEC>(ctx))
            count -= step;
    }

    emitValue<output_OUT>(ctx, count);
}