Button Library
The Button Library provides routines for detecting button presses and debouncing (eliminating the influence of contact flickering upon pressing a button).
Library Routines
Button
Prototype |
sub function Button(dim byref port as word, dim pin as word, dim time as word, dim ActiveState as word) as word |
---|---|
Description |
The function eliminates the influence of contact flickering upon pressing a button (debouncing). The Button pin is tested just after the function call and then again after the debouncing period has expired. If the pin was in the active state in both cases then the function returns 255 (true). |
Parameters |
|
Returns |
|
Requires |
Nothing. |
Example |
|
Notes |
None. |
Copyright (c) 2002-2015 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
What do you think about this topic ? Send us feedback!