read_porta

Description

This function reads a set of noisey inputs tied to PORTA (typically switches or relay contacts) and returns a debounced reading of the selected inputs. This function takes a relatively long time to execute since it looks for a stable reading of the inputs over a predefined period of time. This period is calculated to overcome switch bounce and should not be shortend.

Definition

ubyte read_porta(ubyte mask)

Library

LIB/debounce_lib.bas

Usage



On entry:
mask is a bit wise mask of all the inputs in PORTA which are to be read
On exit:
return true if the stable inputs on PORTA match mask, return false otherwise