Use of BUTTON command
patse
Posts: 3
Hello,
I have a problem with use of the BUTTON command.
Can it only perform an action once?
I need a debounced Pin. Everytime I press it, a number should be increased. Works well with BUTTON command - but only once!!
Can anybody help me?
Thank you!
CODE SNIPPET:
... GOTO up
buttonTest:
count = IsOn
GOTO up
up:
DO
BUTTON 14, 1, 255, 0, buttonBuffer(1), 1, buttonTest
IF (count) THEN
count = IsOff
number= number+ 1
ENDIF
LOOP
I have a problem with use of the BUTTON command.
Can it only perform an action once?
I need a debounced Pin. Everytime I press it, a number should be increased. Works well with BUTTON command - but only once!!
Can anybody help me?
Thank you!
CODE SNIPPET:
... GOTO up
buttonTest:
count = IsOn
GOTO up
up:
DO
BUTTON 14, 1, 255, 0, buttonBuffer(1), 1, buttonTest
IF (count) THEN
count = IsOff
number= number+ 1
ENDIF
LOOP
Comments