From 8569cb45c1914c818cc6f5c4d496ee49f9f3f9c2 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Mon, 18 Dec 2023 20:48:08 +0100 Subject: [PATCH] set pin to INPUT --- gateway/include/Protocol.h | 1 + gateway/include/Protocol_1.h | 1 + gateway/include/RC.h | 1 + gateway/src/gateway.cpp | 1 - 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/include/Protocol.h b/gateway/include/Protocol.h index b0a4498..49c0e56 100644 --- a/gateway/include/Protocol.h +++ b/gateway/include/Protocol.h @@ -18,6 +18,7 @@ public: mySwitch.enableTransmit(SEND_PIN); rcDevice.send(rcSwitch["value"]); mySwitch.disableTransmit(); + pinMode(SEND_PIN, INPUT); } virtual void toJson(unsigned long value, JsonDocument& jsonDoc) { diff --git a/gateway/include/Protocol_1.h b/gateway/include/Protocol_1.h index 330ea33..57ad335 100644 --- a/gateway/include/Protocol_1.h +++ b/gateway/include/Protocol_1.h @@ -17,6 +17,7 @@ public: mySwitch.enableTransmit(SEND_PIN); rcSwitch["state"] ? rcDevice.switchOn(group, channel) : rcDevice.switchOff(group, channel); mySwitch.disableTransmit(); + pinMode(SEND_PIN, INPUT); } void toJson(unsigned long value, JsonDocument& jsonDoc) override { diff --git a/gateway/include/RC.h b/gateway/include/RC.h index 42f38f0..2eea549 100644 --- a/gateway/include/RC.h +++ b/gateway/include/RC.h @@ -11,5 +11,6 @@ namespace RC { void setup() { mySwitch.enableReceive(digitalPinToInterrupt(RECEIVE_PIN)); mySwitch.setRepeatTransmit(10); + pinMode(SEND_PIN, INPUT); } } \ No newline at end of file diff --git a/gateway/src/gateway.cpp b/gateway/src/gateway.cpp index 6c64c86..6067ca5 100644 --- a/gateway/src/gateway.cpp +++ b/gateway/src/gateway.cpp @@ -12,7 +12,6 @@ #define RECEIVE_PIN 2 -RCSwitch mySwitch; SerialReader<200> serialReader; void setup() {