dimm-dev

cesars/rbd-dimm/dimm-dev

If AVR = True Pin value in ZC without effect, auto-define in library. UNO-D2 NANO-D7 Mega-D2 Others board, see README dimmPin = user defined
dimm-dev
@/dimm-dev
If AVR = True Pin value in ZC without effect, auto-define in library. UNO-D2 NANO-D7 Mega-D2 Others board, see README dimmPin = user defined
dimmPinport
PSM dimm PIN
ZCport
PSM dimm PIN
dimm-dev
Dev
Done
dimmPin
ZC
Donepulse
Pulse done
Dev@/dimm-dev
Output to DIMM
To use the node in your project you should have the cesars/rbd-dimm 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 require "https://github.com/Cesar-S/RBDDimmer"


{{#global}}
#include <RBDdimmer.h>
{{/global}}

struct State {
    uint8_t mem[sizeof(dimmerLamp)];
};

using Type = dimmerLamp*;

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isSettingUp())
        return;

    auto state = getState(ctx);

    Type dimm = new (state->mem) dimmerLamp((int)getValue<input_dimmPin>(ctx),(int)getValue<input_ZC>(ctx));
    dimm->begin(NORMAL_MODE, OFF);
    emitValue<output_Done>(ctx, 1);
    emitValue<output_Dev>(ctx, dimm);
}