Attaches is a sample file programmed with the functionality described below that will allow cycle dim via a conditional button by using the press and release tabs.
We have two variables for the button. "Keypat button" to record the state. By default it is "press", whereas we will just be performing a normal button press. The other states are Raise and Lower indicating which step of cycle dim they are in. The other variable is for the lights to toggle; the variable is called Lights and the default state is Off and we have the other state be On.
We also have two sequences, cycle dim raise and cycle dim lower. The cycle dim raise sequence will have the first step be to set the Keypad Button variable to Press for one second, then the variable will be set to Raise for 10 seconds, so if the button is then pressed again, the lights will dim up. The cycle dim lower sequence will have the first step be to set the Keypad Button variable to Press for one second, then the variable will be set to Lower for 10 seconds, so if the button is then pressed again, the lights will dim down. The one second step where the keypad button variable is at press will be used to toggle the lights between on and off if the release tab of the program.
The button programming is as follows:
On the Press Tab:
If the keypad button variable is set to lower, Run the cycle dim sequence and raise the preset for the lights. This means if the last things that was done to the lights was to dim the scene down, on this next press it will raise
If it is not set to lower,
Run the cycle dim lower sequence and dim the lights down. This means the keypad variable was set to raise or press, and then we will begin the cycle dim action if you hold the button press by lowering the lights.
On the Release Tab:
Check if the keypad button variable is a press If it is, and the lights are on, turn them off. If the lights were off, turn them on
If the keypad is not at press,
Stop moving the lights. It was probably doing cycle dim raise or lower, so we stop the lights moving after this release.