273
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
sub
on_button_released
'see how much time has elapsed
if
button.time>
4
then
'the button for pressed for a "long" time -- do one thing
else
'the button was pressed for a "short" time -- do another thing
end
if
end
sub
The button does not requre any pre-configuration and works always.
Note that the
and
events, as well as
R/O property utilize "debouncing", which filters out very short
transitions of the button state. The
R/O property, however, does
not rely on debouncing and returns the immediate state of the button at the very
moment the property is read.
8.3.4.1
On_button_pressed Event
Function:
Generated when the button on your device is pressed.
Declaration:
on_button_pressed
See Also:
Details
Multiple on_button_pressed events may be waiting in the event queue. You can
check the time elapsed since the previous
event by reading
read-only property.
Note that the button object performs "debouncing" which rejects very brief
transitions of the button state. This event will not be generated for such spurious
transitions.
8.3.4.2
On_button_released Event
Function:
Generated when the button on your device is released.
Declaration:
on_button_released
See Also:
Details
Multiple on_button_released events may be waiting in the event queue. You can
check the time elapsed since the previous
event by reading
read-only property.
Note that the button object performs "debouncing" which rejects very brief
transitions of the button state. This event will not be generated for such spurious
273
273
274
274
274
273
274
274
273
274