Set protocol (default is 1, will work for most outlets)
Delaynumber
Set pulse length
Repeatnumber
Number of times to repeat
INITpulse
SEND
OKpulse
Sent OK
OUT@/433-device
To use the node in your project you should have the bradzilla84/433mhz-rcswitch 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
struct State {
};
{{ GENERATED_CODE }}
void evaluate(Context ctx) {
if (!isInputDirty<input_INIT>(ctx))
return;
if (isSettingUp()){
auto state = getState(ctx);
auto rcswitch = getValue<input_IN>(ctx);
rcswitch->enableTransmit(getValue<input_DataPin>(ctx)); // Data pin on Arduinoo to Transmitter
}
auto state = getState(ctx);
auto rcswitch = getValue<input_IN>(ctx);
rcswitch->setProtocol(getValue<input_Protocol>(ctx));
rcswitch->setPulseLength(getValue<input_Delay>(ctx));
rcswitch->setRepeatTransmit(getValue<input_Repeat>(ctx));
rcswitch->send(getValue<input_Value>(ctx), getValue<input_Bitlength>(ctx));
emitValue<output_OK>(ctx, 1);
emitValue<output_OUT>(ctx, rcswitch);
}