Timer
timer_start | gtt
- How:
timer_start(element_index[element_number], timer)
- element_index[element_number]: integer, ranging 0...15 or 0...11 if using PBF4 or 0...7 if using EF44
- if you call 16 for the timer it will start the global timer
- timer: integer, ranging 0...65535
- element_index[element_number]: integer, ranging 0...15 or 0...11 if using PBF4 or 0...7 if using EF44
- What: This function starts a timer when called, when the timer runs out (defined by the
timer
parameter, given apx. in milliseconds) the Timer UI event will run. - Example: Using the code
timer_start(num, 500)
on a BU16 button will start the timer when the button is pressed down and the defined Action Chain under the Timer event on this Control Element will run after ~ 500 ms have passed. This is useful if you want to have effects timeout independent from physically triggered events, like a button being pushed.
timer_stop | gtp
How:
timer_stop(element_index[element_number])
- element_index[element_number]: integer, ranging 0...15 or 0...11 if using PBF4 or 0...7 if using EF44
- if you call
-1
for the timer it will stop the system timer
- if you call
- element_index[element_number]: integer, ranging 0...15 or 0...11 if using PBF4 or 0...7 if using EF44
What: When this function is called, the timer function (if there is one running) will stop immediately.
Example: This function is useful as a break kind of function. Meaning you can immediately end a timer running when a certain condition is met like: