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
DONEpulse
Pulse done
DIMM'@/dimm-dev
Output 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
#pragma XOD require "https://github.com/Cesar-S/RBDDimmer"
#include <RBDdimmer.h>
node {
static_assert(isValidDigitalPort(constant_input_dimmPin), "must be a valid digital port");
static_assert(isValidDigitalPort(constant_input_ZC), "must be a valid digital port");
meta{
using Type = dimmerLamp*;
}
uint8_t mem[sizeof(dimmerLamp)];
void evaluate(Context ctx) {
if (!isSettingUp())return;
Type dimm = new (mem) dimmerLamp(constant_input_dimmPin,constant_input_ZC);
dimm->begin(NORMAL_MODE, OFF);
emitValue<output_DIMMU0027>(ctx, dimm);
emitValue<output_DONE>(ctx, 1);
}
}