Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions | List of all members
ArduinoMatrixButton Class Reference

Represents a single button in a matrix configuration. More...

#include <ArduinoMatrixButton.h>

Inheritance diagram for ArduinoMatrixButton:
Inheritance graph
[legend]
Collaboration diagram for ArduinoMatrixButton:
Collaboration graph
[legend]

Public Member Functions

 ArduinoMatrixButton (inputid_t id, inputpin_t colPin, inputpin_t rowPin)
 Creates a new button in a matrix configuration. More...
 
inputpin_t getColPin () const
 Gets the pin attached to the matrix column for this button. More...
 
inputpin_t getRowPin () const
 Gets the pin attached to the matrix row for this button. More...
 
- Public Member Functions inherited from IButton
 IButton (inputid_t id, inputtime_t debounceDelay=50)
 Creates a new button. More...
 
inputtype_t type () const
 Retrieves the type of this device. More...
 
bool setDebounceDelay (inputtime_t debounce)
 Sets the debounce delay time. More...
 
inputtime_t getDebounceDelay () const
 Gets the current debounce delay time. More...
 
bool poll ()
 Polls this input device for change. More...
 
bool isActive () const
 Determines if the button is currently active. More...
 
inputtime_t lastStateChange () const
 Returns the time of the last state change. More...
 
inputtime_t lastActiveDuration () const
 Returns the duration for which the button was last active. More...
 
- Public Member Functions inherited from IInputDevice
 IInputDevice (inputid_t id)
 Creates a new input device. More...
 
inputid_t getID () const
 Retrieves the ID of this device. More...
 

Protected Member Functions

uint8_t getPhysicalState () const
 Gets the current physical state of the button. More...
 

Detailed Description

Represents a single button in a matrix configuration.

Constructor & Destructor Documentation

ArduinoMatrixButton::ArduinoMatrixButton ( inputid_t  id,
inputpin_t  colPin,
inputpin_t  rowPin 
)

Creates a new button in a matrix configuration.

Parameters
idID of the button
colPinPin connected to the matrix column of the button
rowPinPIn connected to the matrix row of the button

Member Function Documentation

inputpin_t ArduinoMatrixButton::getColPin ( ) const
inline

Gets the pin attached to the matrix column for this button.

Returns
Pin number
uint8_t ArduinoMatrixButton::getPhysicalState ( ) const
protectedvirtual

Gets the current physical state of the button.

Returns
True if button state is high

Implements IButton.

inputpin_t ArduinoMatrixButton::getRowPin ( ) const
inline

Gets the pin attached to the matrix row for this button.

Returns
Pin number

The documentation for this class was generated from the following files: