PDA

View Full Version : BUTTON statement without repeat rate variable?



CuriousOne
- 18th April 2014, 09:44
Hello.

I have certain project, which uses 11 buttons. They have no repeat, but BUTTON statement requires separate BVAR variable (button variable) to be declared for all buttons. Is there a way to skip usage of this variable?

I know that I can do without BUTTON statement at all, but I like they way it works (debounce and code stopped until you release button).

Amoque
- 18th April 2014, 14:37
A quick check of the manual does not show the square brackets "[ ]" typically used to denote optional parameters; perhaps one might use the same variable on all buttons however- presuming it is initialized to zero before each use.



If Button = pressed then
pause 100 'debounce
HOLDINGBUTTON: If Button = Pressed then 'still depressed
pause 100 'wait for release of button
Goto HOLDINGBUTTON
Elseif Button = NotPressed
Do something
EndIf
Endif