Plugin 01 (Switch ) Push Button Longpress

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pw444
Normal user
Posts: 155
Joined: 23 Apr 2019, 15:34
Location: rio de janeiro

Plugin 01 (Switch ) Push Button Longpress

#1 Post by pw444 » 16 Jan 2021, 15:03

Hya,

for an application i'm building, i have a push button but want to trigger with long press only, to avoid and triggering by touching by mistake.

Is there a way to "disable" to short press?

Some samples for the following?

Long press event: If enabled the unit will detect a long press of a button. There’s three different behaviors of the long press:

Active only on low: this means that the unit will only be triggering the long press event if the signal is low. Two different event values are used, 10 if the state goes from 0 to 1 (Switch#State=10), and 11 if the state goes from 1 to 0 (Switch#State=11).

Active only on high: same as above but only triggered on high signal.

Active on high & low: the long press will be triggered both on high and low signals.

Thanks in advance!

User avatar
Grumpf
Normal user
Posts: 124
Joined: 05 May 2017, 23:45
Location: Namur

Re: Plugin 01 (Switch ) Push Button Longpress

#2 Post by Grumpf » 16 Jan 2021, 16:02

Simply don't assign any action to it.

I say that theorically, longpress or double never worked for me so far.

pw444
Normal user
Posts: 155
Joined: 23 Apr 2019, 15:34
Location: rio de janeiro

Re: Plugin 01 (Switch ) Push Button Longpress

#3 Post by pw444 » 16 Jan 2021, 18:27

Grumpf wrote: 16 Jan 2021, 16:02 Simply don't assign any action to it.

I say that theorically, longpress or double never worked for me so far.
i was confused, as the docs are mostly not very friendly. Anyway, i spent about one hour testing, digging and found out the it works like a charm....

And doubleclick also works..

Code: Select all

on PB#status do
   if %eventvalue%=11   // pb#status 11 - long press and v1 = 0 -> turn ON
      if %v1%=0
         gpio,13,1
         let,1,1 
      else              // pb#status 11 - long press and v1 = 1 -> turn off
         gpio,13,0
         let,1,0   
      endif
   endif
endon   
i'm still testing, but 'till now, can only send a big applause to the developers for this f*cking good piece of software. Not friendly at all, mostly examples are needed to understand how it works.

And as i'm a very lazy dog, i memorize almost nothing, i just learn, but don't memorize syntaxes, etc... i do it and save for later reference.
Last edited by pw444 on 16 Jan 2021, 20:22, edited 2 times in total.

User avatar
Grumpf
Normal user
Posts: 124
Joined: 05 May 2017, 23:45
Location: Namur

Re: Plugin 01 (Switch ) Push Button Longpress

#4 Post by Grumpf » 16 Jan 2021, 19:53

Glad you managed, I'll try again and share my experience with you if you don't mind.
Talk to you soon,
Thanks.

pw444
Normal user
Posts: 155
Joined: 23 Apr 2019, 15:34
Location: rio de janeiro

Re: Plugin 01 (Switch ) Push Button Longpress

#5 Post by pw444 » 16 Jan 2021, 20:19

Grumpf wrote: 16 Jan 2021, 19:53 Glad you managed, I'll try again and share my experience with you if you don't mind.
Talk to you soon,
Thanks.
sure! i'm allways open learn and share.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests