Jump to content
C4 Forums | Control4

Press & Hold Function?


andy.cytexone

Recommended Posts


Hey guys, here's what seems to work for me.

1- create a variable called button_pressed

2- create a variable called hold

under the when button is pressed:

-set button_pressed to true

-delay 1500 miliseconds

-if variable button pressed is true

--set hold to true

under button release

-set button_pressed to false

-if hold is false-

--execute what you want when button is not held

-if hold is true-

--execute what you want when button is held for what I have found to be 3 seconds due to processor delay.

--set hold to false

This has been working great for me for months. Let me know how you make out.

Jamman

Link to comment
Share on other sites

Glad I could help. This is what makes this stuff fun. Many ways to accomplish the same thing.

Reading these posts only makes you aware that many guys are out there slaving away, with little time

to waste trying to make stuff work right. As a group we can build a good knowledge base!

Great work on the forum!

Cheers,

Serge

Link to comment
Share on other sites

False for both

because the button is not pressed by default.

Otherwise your buttons will need to be pressed twice for the programming to get proper status after every reboot or update.

Maybe when Director runs a little faster, we can reliably lower the 3 sec hold time to 2 sec., as for now it always works when held for 3sec. Does work @ 2 sec sometimes, but rarely.

I don't mind the full 3 sec hold at my house. The kids like to press buttons sometimes, and my hold feature is my good night mode button which turns off all the TV's, music, Lights in the house. They don't know you can hold the button and something else happens yet and I'm not telling.

Link to comment
Share on other sites

I simply have a turn room off for each room one after the other combined with a good night scene. As a visual, when this executes, I flash the button LED 3 different colors and then I ramp the pathway to the stairs up to 50% before executing the good night scene, which is a 20 second fade.

It works everytime and gives us a pratical one touch. If we press the button(not hold), I toggle the Kitchen counter LCD. The button LED follows the power state of the room.

Jamman

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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