Switch GPIOx on GPIOy behaviour

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
njordan
New user
Posts: 8
Joined: 29 Mar 2016, 23:54

Switch GPIOx on GPIOy behaviour

#1 Post by njordan » 04 Sep 2021, 08:59

Hi,
can someone please help me to find a rule (if possible at all) that only turns on GPIOx for 5sec if GPIOy has been pressed two times in a row....so two positive slopes within a certain time....like within 2secs....
I know its rather specific but i hope that i can use espeasy and still support this task. Many thanks...my starting point is the rule i found in the forum but this is far from the intended action. Thanks a lot for your support, NORBERT

on Button#Value do
if [Button#Value] = 1
EXTGPIO,16,1
else
EXTGPIO,16,0
endif
endon

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Switch GPIOx on GPIOy behaviour

#2 Post by TD-er » 04 Sep 2021, 16:12

The switch plugin also allows to detect a doubleclick.
It will then generate an event with a different event value (have to look into the code, but I think it was event value 11)

So it will be something like this: (assuming the switch task is named "button" and the task value is "switch")

Code: Select all

on button#switch=11 do
  timerSet,1,5 // Set timer 1 to 5 seconds
  gpio,16,1
endon

	
on Rules#Timer=1 do
 GPIO,16,0
endon

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests