Jump to content
C4 Forums | Control4

Enabling progamming by holding down a button


Brad_The_Lucky

Recommended Posts

With all the good ideas being posted lately, I thought I'd just share how I enable a 2 second hold down functionality. There seem to some very complex alternatives being posted too!

I have a 6 button in my master bedroom. When I push button 6, everything in the master bedroom turns off. However, if I push the button and hold it for 2 seconds, the entire house will shut off.

See attachments.....

Link to comment
Share on other sites


With all the good ideas being posted lately, I thought I'd just share how I enable a 2 second hold down functionality. There seem to some very complex alternatives being posted too!

I have a 6 button in my master bedroom. When I push button 6, everything in the master bedroom turns off. However, if I push the button and hold it for 2 seconds, the entire house will shut off.

See attachments.....

Brad, that's really awesome. Very elegant. I've just replaced about 10 lines of code for one of my delay switches with about 3 lines thanks to your post. Thanks!

I also created a single variable, called PAUSE, which I'm going to use anywhere that I have those short delays. I think the risk that two people are using a PAUSE function at the same time is pretty slim, and since your code sets it back to FALSE at button release, it will always be in the correct default state.

c41zr5.jpg

c42zy2.jpg

Thanks, Brad!!

Link to comment
Share on other sites

  • 3 months later...

Archived

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

×
×
  • Create New...