From 318ff34fbf3eefbd7ad86e857645dba4f48f5763 Mon Sep 17 00:00:00 2001 From: fanta Date: Wed, 17 Aug 2022 02:22:32 +0200 Subject: [PATCH] arduino files --- receive.arduino.ino | 15 +++++++++++++++ send.arduino.ino | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 receive.arduino.ino create mode 100644 send.arduino.ino 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); +}