set pin to INPUT

This commit is contained in:
Nicu Hodos 2023-12-18 20:48:08 +01:00
parent f9b8797951
commit 8569cb45c1
4 changed files with 3 additions and 1 deletions

View File

@ -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) {

View File

@ -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 {

View File

@ -11,5 +11,6 @@ namespace RC {
void setup() {
mySwitch.enableReceive(digitalPinToInterrupt(RECEIVE_PIN));
mySwitch.setRepeatTransmit(10);
pinMode(SEND_PIN, INPUT);
}
}

View File

@ -12,7 +12,6 @@
#define RECEIVE_PIN 2
RCSwitch mySwitch;
SerialReader<200> serialReader;
void setup() {