Jump to content
C4 Forums | Control4
  • 0

Timers and Button Pushes


Topfox

Question

Have a remote that only recognizes button pushes and release.  No double tap or anything like that. 
 

id like to make this button a double use button and am trying to figure out a way to do that creatively. Was thinking maybe a timer. Press the button starts a timer. At the end of the timer it completes and action. Say turn off the system. However if you press the button a second time before the timer is complete it will switch inputs instead of turning off the system. 
 

I haven’t played around with timers at all, but would something like work/is that possible?  Or any other creative thoughts on how I might be able to turn a single button into a dual purpose button. 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

I do this with a 2 second timer.

Every button push adds 1 to a user variable (let’s call it ButtonPushed) 

On ButtonPushed changes, I have the following:

      If ButtomPushed = 1 start timer

On timer expires, I have:

     look at value of ButtonPushed and decide what to do (I use 1, 2, 3 and 4 or more as my conditionals).

     set ButtonPushed to 0

 

My primary use of this code is to give more flexibility to the 3 custom buttons on SR260 remotes and to make the red button on all of my remotes into a panic button (if pressed multiple times).

 

 

 

Link to comment
Share on other sites


  • 0
22 minutes ago, South Africa C4 user said:

I do this with a 2 second timer.

Every button push adds 1 to a user variable (let’s call it ButtonPushed) 

On ButtonPushed changes, I have the following:

      If ButtomPushed = 1 start timer

On timer expires, I have:

     look at value of ButtonPushed and decide what to do (I use 1, 2, 3 and 4 or more as my conditionals).

     set ButtonPushed to 0

 

My primary use of this code is to give more flexibility to the 3 custom buttons on SR260 remotes and to make the red button on all of my remotes into a panic button (if pressed multiple times).

 

 

 

Cool. Thanks. I’m going to play with it. 

Link to comment
Share on other sites

  • 0

although I ended up doing something else, I may still go back to this.  Can you tell me how you get the button presses to count in the variable? I couldnt seem to figure out how to get it to increment with out doing a set which then its not counting the pushes.  Unless Im missinog something which Im sure I am.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.