if-else(rgb-color)

awgrover/adafruitneopixel/if-else(rgb-color)

Outputs either input value depending on condition
if-else(rgb-color)
@/if-else(rgb-color)
Outputs either input value depending on condition
CONDboolean
Condition value
T@/rgb-color
Value to be output if condition is true
F@/rgb-color
Value to be output if condition is false
if-else(rgb-color)
R
COND
T
F
R@/rgb-color
Outputs value of `T` if `COND` is true, and `F` otherwise
To use the node in your project you should have the awgrover/adafruitneopixel 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 dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto cond = getValue<input_COND>(ctx);
    auto trueVal = getValue<input_T>(ctx);
    auto falseVal = getValue<input_F>(ctx);
    emitValue<output_R>(ctx, cond ? trueVal : falseVal);
}