dimm-toggle-set

cesars/dimmer/dimm-toggle-set

Dimmer toggle beetwen min-max
dimm-toggle-set
@/dimm-toggle-set
Dimmer toggle beetwen min-max
DIMM@/dimm-dev
Input to dev
MINnumber
Min value power >=0
MAXnumber
Max value power <=100
SETpulse
Pulse for set power in toggle mode
dimm-toggle-set
DIMM'
DONE
DIMM
MIN
MAX
SET
DONEpulse
Pulse done
DIMM'@/dimm-dev
Output Dev to DIMM
To use the node in your project you should have the cesars/dimmer 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

node {
    void evaluate(Context ctx) {
        emitValue<output_DIMMU0027>(ctx, getValue<input_DIMM>(ctx));
        if (!isInputDirty<input_SET>(ctx))return;

        auto dimm = getValue<input_DIMM>(ctx);
        int min = getValue<input_MIN>(ctx);
        int max = getValue<input_MAX>(ctx);
        dimm->toggleSettings(min, max);
        emitValue<output_DONE>(ctx, 1);
    }
}