Serial Wombat Arduino Library
|
Class that runs on top of SerialWombatMatrixKeypad to treat a key as an individual button. More...
#include <SerialWombatMatrixKeypad.h>
Public Member Functions | |
SerialWombatMatrixButton (SerialWombatMatrixKeypad &kp, uint8_t keyIndex) | |
Instantiate a SerialWombatMatrixButton. More... | |
bool | digitalRead () |
Returns the state of the input. More... | |
uint16_t | readDurationInFalseState_mS () |
return the number of mS that the button has been in false state More... | |
uint16_t | readDurationInTrueState_mS () |
return the number of mS that the button has been in true state More... | |
bool | readTransitionsState () |
Queries the number of transistions that have occured on the button. More... | |
Public Member Functions inherited from SerialWombatAbstractButton | |
SerialWombatAbstractButton () | |
virtual bool | readTransitionsState (bool resetTransitionCounts=true)=0 |
Queries the number of transistions that have occured on the debounced input. More... | |
Additional Inherited Members | |
Public Attributes inherited from SerialWombatAbstractButton | |
uint16_t | transitions = 0 |
Number of transitions returned by last call to readTransitionsState() More... | |
Class that runs on top of SerialWombatMatrixKeypad to treat a key as an individual button.
This class allows a single key from a SerialWombatMatrixKeypad to be treated as an individual SerialWombatAbstractButton that can be read as such or passed to SerialWombatButtonCounter .
|
inline |
Instantiate a SerialWombatMatrixButton.
kp | An initialized SerialWombatMatrixKeypad |
keyIndex | a number 0-15 indicating which key (index, not ascii value) is treated as a button |
|
inlinevirtual |
Returns the state of the input.
This function reads from the public data of the pin which indicates the state of the input
Implements SerialWombatAbstractButton.
|
inlinevirtual |
return the number of mS that the button has been in false state
Implements SerialWombatAbstractButton.
|
inlinevirtual |
return the number of mS that the button has been in true state
Implements SerialWombatAbstractButton.
|
inline |
Queries the number of transistions that have occured on the button.
This function queries the button for current state and transitions since last call. transition count is put in the global member transitions. The keypad driver in the Serial Wombat chip resets its count to zero after this call.