set-all-to-off-neopixel

bradzilla84/neopixel/set-all-to-off-neopixel

Sel ALL Pixel's to OFF
set-all-to-off-neopixel
@/set-all-to-off-neopixel
Sel ALL Pixel's to OFF
DEV@/neopixel-device
INITpulse
Pulse to Set
set-all-to-off-neopixel
DEV
INIT
OUT
OK
OKpulse
OUT@/neopixel-device
To use the node in your project you should have the bradzilla84/neopixel 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) {
    // The node responds only if there is an input pulse
    if (!isInputDirty<input_INIT>(ctx)){
    emitValue<output_OUT>(ctx, getValue<input_DEV>(ctx));
        return;}

    // Get a pointer to the `OLED` class instance
    auto pixels = getValue<input_DEV>(ctx);

    for(uint16_t i=0; i<pixels->numPixels(); i++) {
    pixels->setPixelColor(i, 0,0,0);
    }
    pixels->show();

    emitValue<output_OUT>(ctx, pixels);
    emitValue<output_OK>(ctx, 1);
}