Hello,
i want to switch my 433Mhz sockets on/off by sending an IR code.
I connected a TSOP4838 to receive codes from my remote control
and a generic TX-module for sending the 433 codes.
I was be able to switch LED’s on/off by sending the right IR code in a previous sketch.
If i want to send 433 codes instead of power a LED on, the mySwitch.send isn’t working.
Code:
#include <IRremote.h>
#include <RCSwitch.h>
int RECV_PIN = 10;
IRrecv irrecv(RECV_PIN);
RCSwitch mySwitch = RCSwitch();
decode_results results;
void setup()
{
Serial.begin(9600);
mySwitch.enableTransmit(11);
mySwitch.setPulseLength(510);
mySwitch.setProtocol(5);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, DEC);
if (results.value == 607313426 )
{mySwitch.send(“000100011001111000110100”);
}
if (results.value == 3197093763)
{mySwitch.send(“000100100101010100010100”);
}
irrecv.resume(); // Receive the next value
}
}