Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
Keypad< PIN, DEBOUNCE > Class Template Reference

#include <Keypad.h>

Collaboration diagram for Keypad< PIN, DEBOUNCE >:
Collaboration graph

Public Member Functions

 Keypad (const uint16_t *map=NULL)
 
bool ischanged ()
 
uint8_t key ()
 
uint16_t timestamp ()
 

Protected Attributes

uint16_t m_timestamp
 
uint8_t m_key
 
const uint16_t * m_map
 

Detailed Description

template<int PIN, uint16_t DEBOUNCE = 50>
class Keypad< PIN, DEBOUNCE >

Resistor ladder keypad read and debounce template class.

Parameters
[in]PINanalog pin.
[in]DEBOUNCEtime limit (default 50 ms).

Definition at line 28 of file Keypad.h.

Constructor & Destructor Documentation

template<int PIN, uint16_t DEBOUNCE = 50>
Keypad< PIN, DEBOUNCE >::Keypad ( const uint16_t *  map = NULL)
inline

Construct keypad with given template parameters.

Definition at line 33 of file Keypad.h.

Member Function Documentation

template<int PIN, uint16_t DEBOUNCE = 50>
bool Keypad< PIN, DEBOUNCE >::ischanged ( )
inline

Check if it is time to sample the keypad and check for key pressed/release.

Returns
true(1) if a change was detected, otherwise false(0).

Definition at line 45 of file Keypad.h.

template<int PIN, uint16_t DEBOUNCE = 50>
uint8_t Keypad< PIN, DEBOUNCE >::key ( )
inline

Return latest key.

Returns
key number.

Definition at line 65 of file Keypad.h.

template<int PIN, uint16_t DEBOUNCE = 50>
uint16_t Keypad< PIN, DEBOUNCE >::timestamp ( )
inline

Return debounce timestamp.

Returns
timestamp.

Definition at line 75 of file Keypad.h.

Member Data Documentation

template<int PIN, uint16_t DEBOUNCE = 50>
uint8_t Keypad< PIN, DEBOUNCE >::m_key
protected

Latest debounced key.

Definition at line 86 of file Keypad.h.

template<int PIN, uint16_t DEBOUNCE = 50>
const uint16_t* Keypad< PIN, DEBOUNCE >::m_map
protected

Key map; program memory with values in descent order.

Definition at line 89 of file Keypad.h.

template<int PIN, uint16_t DEBOUNCE = 50>
uint16_t Keypad< PIN, DEBOUNCE >::m_timestamp
protected

Timestamp for latest pin read.

Definition at line 83 of file Keypad.h.


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