433-send

bradzilla84/433mhz-rcswitch/433-send

Send a Command
433-send
@/433-send
Send a Command
IN@/433-device
DataPinport
Data pin on Arduinoo to Transmitter
Valuenumber
Code to send
Bitlengthnumber
Bit Length
Protocolnumber
Set protocol (default is 1, will work for most outlets)
Delaynumber
Set pulse length
Repeatnumber
Number of times to repeat
INITpulse
SEND
433-send
OUT
IN
OK
DataPin
Value
Bitlength
Protocol
Delay
Repeat
INIT
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);
}