diff --git a/receive.arduino.ino b/receive.arduino.ino new file mode 100644 index 0000000..805fea7 --- /dev/null +++ b/receive.arduino.ino @@ -0,0 +1,15 @@ +#include + +RCSwitch mySwitch = RCSwitch(); + +void setup() { + Serial.begin(9600); + mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2 +} + +void loop() { + if (mySwitch.available()) { + output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol()); + mySwitch.resetAvailable(); + } +} diff --git a/send.arduino.ino b/send.arduino.ino new file mode 100644 index 0000000..2ddaeaf --- /dev/null +++ b/send.arduino.ino @@ -0,0 +1,19 @@ +#include + +RCSwitch mySwitch = RCSwitch(); + +void setup() { + + Serial.begin(9600); + + // Transmitter is connected to Arduino Pin #10 + mySwitch.enableTransmit(10); + +} + +void loop() { + + /* using binary code */ + mySwitch.send("01100101 01111000 01101010"); + delay(100); +}