Serial Wombat Arduino Library

Loading...
Searching...
No Matches
Public Member Functions | List of all members
SerialWombatMatrixButton Class Reference

Class that runs on top of SerialWombatMatrixKeypad to treat a key as an individual button. More...

`#include <SerialWombatMatrixKeypad.h>`

Inheritance diagram for SerialWombatMatrixButton:
[legend]
Collaboration diagram for SerialWombatMatrixButton:
[legend]

## Public Member Functions
| SerialWombatMatrixButton (SerialWombatMatrixKeypad &kp, uint8_t keyIndex)
| Instantiate a SerialWombatMatrixButton.
bool | digitalRead ()
| Returns the state of the input.
uint16_t | readDurationInFalseState_mS ()
| return the number of mS that the button has been in false state
uint16_t | readDurationInTrueState_mS ()
| return the number of mS that the button has been in true state
bool | readTransitionsState (bool resetTransitionCount=true)
| Queries the number of transistions that have occured on the button.
Public Member Functions inherited from SerialWombatAbstractButton
| SerialWombatAbstractButton ()

## Additional Inherited Members
Public Attributes inherited from SerialWombatAbstractButton
uint16_t | transitions = 0
| Number of transitions returned by last call to readTransitionsState()

## Detailed Description

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 .

Definition at line 394 of file SerialWombatMatrixKeypad.h.

## Constructor & Destructor Documentation

## ◆ SerialWombatMatrixButton()

SerialWombatMatrixButton::SerialWombatMatrixButton | ( | SerialWombatMatrixKeypad & | kp,
|  | uint8_t | keyIndex )
| inline

Instantiate a SerialWombatMatrixButton.

Parameters

  kp | An initialized SerialWombatMatrixKeypad
  keyIndex | a number 0-15 indicating which key (index, not ascii value) is treated as a button

Definition at line 403 of file SerialWombatMatrixKeypad.h.

## Member Function Documentation

## ◆ digitalRead()

bool SerialWombatMatrixButton::digitalRead | ( |  | ) |
| inline virtual

Returns the state of the input.

This function reads from the public data of the pin which indicates the state of the input

Returns
  TRUE for pressed or FALSE.

Implements SerialWombatAbstractButton.

Definition at line 417 of file SerialWombatMatrixKeypad.h.

## ◆ readDurationInFalseState_mS()

uint16_t SerialWombatMatrixButton::readDurationInFalseState_mS | ( |  | ) |
| inline virtual

return the number of mS that the button has been in false state

Returns
  returns a value in mS which saturates at 65535. Returns 0 if currently true.

Implements SerialWombatAbstractButton.

Definition at line 440 of file SerialWombatMatrixKeypad.h.

## ◆ readDurationInTrueState_mS()

uint16_t SerialWombatMatrixButton::readDurationInTrueState_mS | ( |  | ) |
| inline virtual

return the number of mS that the button has been in true state

Returns
  returns a value in mS which saturates at 65535. Returns 0 if currently false.

Implements SerialWombatAbstractButton.

Definition at line 466 of file SerialWombatMatrixKeypad.h.

## ◆ readTransitionsState()

bool SerialWombatMatrixButton::readTransitionsState | ( | bool | resetTransitionCount = true | ) |
| inline virtual

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.

Returns
  TRUE or FALSE, current status of debounced input

Implements SerialWombatAbstractButton.

Definition at line 496 of file SerialWombatMatrixKeypad.h.