Hi everybody,
I am trying to get a 433 MHz transmitter to send commands to activate and deactivate RC power outlets.
I am using the RCswitch library with an arduino Uno (http://code.google.com/p/rc-switch/).
The receiver works fine, I can receive signals send via the remote control that came with the power sockets. However, the transmitter does not work yet.
Receiver module: RF Link Receiver - 4800bps (434MHz) - WRL-10532 - SparkFun Electronics
Transmitter module: RF Link Transmitter - 434MHz - WRL-10534 - SparkFun Electronics
Receiver Code (receive example from the rcswitch library...):
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
}
void loop() {
if (mySwitch.available()) {
output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
mySwitch.resetAvailable();
}
}
Transmitter Code:
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
int led = 11;
void setup() {
Serial.begin(4800);
Serial.println("Setup");
// Transmitter is connected to Arduino Pin #10
mySwitch.enableTransmit(10);
// Optional set pulse length.
mySwitch.setPulseLength(360);
// Optional set protocol (default is 1, will work for most outlets)
// mySwitch.setProtocol(2);
// Optional set number of transmission repetitions.
mySwitch.setRepeatTransmit(15);
pinMode(led, OUTPUT);
}
void loop() {
// STECKDOSE: ELRO, A
/* Same switch as above, but using binary code */
mySwitch.send("010001000000010101010001");
digitalWrite(led, HIGH);
Serial.println("ON");
delay(1000);
mySwitch.send("010001000000010101010100");
digitalWrite(led, LOW);
Serial.println("OFF");
delay(1000);
}
Has anybody similar problems with the transmitter? Can anybody help me out?
Any help is greatly appreciated!
Papillon