Connect Input with output

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Adrian08642
Normal user
Posts: 13
Joined: 15 Sep 2020, 18:14

Connect Input with output

#1 Post by Adrian08642 » 04 Oct 2021, 00:15

Hello, I have no idea about ESPEasy and I think I have a very simple problem.
I have set up my WEMOS and only want to connect a GPIO input to a GPIO output. So if pin 13 (D7 / input) is switched, pin 14 (D5 / output) should also be switched.
I flashed everything and with the command "http://192.168.2.145/control?cmd=GPIO,14,0" pin 14 can also be switched.
Many thanks for the help
Adrian

User avatar
Ath
Normal user
Posts: 3416
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Connect Input with output

#2 Post by Ath » 04 Oct 2021, 08:33

Ah, yes, this is not as clear as it could be.
Easiest to achieve that is by adding a Switch device on the devices page (name it 'Switch' please, and set Enabled on) that is configured to GPIO13/D7, and set the de-bounce value to 150 msec.
Next you should enable the Rules option on Tools/Advanced page, then a new tab Rules will be added to the list of tabs (may require a browser refresh).
Then in the first Rules file you can add this code:

Code: Select all

on Switch#State do
  GPIO,14,%eventvalue1%
endon
If the output is the reverse of what you need, enable the 'Inverted Logic' checkbox in the Switch device.
If you want to state to be reflected faster on the Devices page, then the 'Interval' setting on the Switch can be set to a lower value (down to 1).
/Ton (PayPal.me)

Adrian08642
Normal user
Posts: 13
Joined: 15 Sep 2020, 18:14

Re: Connect Input with output

#3 Post by Adrian08642 » 04 Oct 2021, 16:35

Thank you very much you helped me a lot.

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests