433-receive

bradzilla84/433mhz-rcswitch/433-receive

Output Received Commands.
433-receive
@/433-receive
Output Received Commands.
IN@/433-device
interruptnumber
Interrupt to Use. Default 0 = Pin #2
INITpulse
Update
433-receive
OUT
IN
Value
Bitlength
Delay
Rawdata
Protocol
Rec
interrupt
INIT
Recpulse
Signal Received
Protocolnumber
Protocol of signal
Rawdatanumber
Raw Data output
Delaynumber
Delay of signal
Bitlengthnumber
Bit Length
Valuenumber
Output Code
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->enableReceive(getValue<input_interrupt>(ctx));  // Receiver on interrupt 0 => that is pin #2
    }

    auto state = getState(ctx);
    auto rcswitch = getValue<input_IN>(ctx);

    if (rcswitch->available()) {
        Number result = Number(rcswitch->getReceivedValue());
        emitValue<output_Value>(ctx, result);
        emitValue<output_Bitlength>(ctx, rcswitch->getReceivedBitlength());
        emitValue<output_Delay>(ctx, rcswitch->getReceivedDelay());
        emitValue<output_Rawdata>(ctx, *rcswitch->getReceivedRawdata());
        emitValue<output_Protocol>(ctx, rcswitch->getReceivedProtocol());
        emitValue<output_Rec>(ctx, 1);

        rcswitch->resetAvailable();
    }
    emitValue<output_OUT>(ctx, rcswitch);
}