dimm-set-power

cesars/dimmer/dimm-set-power

Set power 0...100%
dimm-set-power
@/dimm-set-power
Set power 0...100%
DIMM@/dimm-dev
Intput to dev
POWERnumber
Power value 0-100
SETpulse
Pulse for set power value
dimm-set-power
DIMM
POWER
SET
DIMM'
DONE
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);
        uint8_t val = getValue<input_POWER>(ctx);
        dimm->setPower(val);
        emitValue<output_DONE>(ctx, 1);
    }
}