Jump to content
C4 Forums | Control4

Complexish toggle scheme


Recommended Posts

I can think of a dozen clunky ways to do this, so I am wondering what the brains here think.

We have 6 key pads with the bottom taken by a volume up/down. We are using most buttons as a toggle - for instance button 3 toggles between controlling the sun shade and the black out shade, sets a  LED color based on what is selected, then the volume button sets the shade up or down. Easy enough as this is a boolean.

What I am trying to do is use a button to cycle through selecting a particular light, flash the light when selected, and then the volume buttons dim up/down, both pressed power on/off the light.

Thoughts on how to do this without a million IFs? I figure on each button press cycle through a numeric variable. Then I trail off on really ugly ideas. If Button Value = 3 turn on light X for 500ms. 30 IFs later I have my behavior. What's a better way? I imagine I am not thinking of something relatively elegant.

EDIT: Bonus points if you can think of a way to take a snapshot of the LED state before an action to then reinstate the LEDs. Where I am going with this is set fan speed, use the LEDs in each button to show fan speed (button 2, 3,4,5 light red when fan is set to 4, button 3,4,5 set to red when fan is set to 3, so on) and after a timer expires the LEDs return to their previous state as button 2-4 indicate something else the rest of the time. I have done this on a pad with a zillion IFs, but it was hairy.

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.

Reply to this topic...

×   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.