dimm-on-off

cesars/dimmer/dimm-on-off

Set state ON-OFF
dimm-on-off
@/dimm-on-off
Set state ON-OFF
DIMM@/dimm-dev
Intput to Dev
ON-OFFboolean
True=ON / False=OFF
SETpulse
Pulse for set state
dimm-on-off
DIMM'
DONE
DIMM
ON-OFF
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);
        if (isInputDirty<input_SET>(ctx)){
            if(getValue<input_ON_OFF>(ctx) == true){
                dimm->setState(ON);
            }else{
                dimm->setState(OFF);
            }
        }
        emitValue<output_DONE>(ctx, 1);
    }
}