Pin base class reading direct from the pin (without debouncing).
More...
#include <Pins.h>
|
| Pin (uint8_t pin, uint8_t initState) |
| Protected constructor used by sub-classes. More...
|
|
void | readPin () |
| Read the pin directly. More...
|
|
int | clicks (uint8_t pressed, uint8_t released) |
| Return the number of clicks. More...
|
|
|
static uint8_t | nextId () |
| Return the next auto-assigned button identifier. More...
|
|
Pin base class reading direct from the pin (without debouncing).
Other pins inherit directly/indirectly from this base class. This class cannot be instantiated directly. Instantiation comes through Button sub-classes.
Definition at line 17 of file Pins.h.
◆ Pin()
able::Pin::Pin |
( |
uint8_t |
pin, |
|
|
uint8_t |
initState |
|
) |
| |
|
inlineprotected |
Protected constructor used by sub-classes.
Use a Button sub-class instead of this class directly.
- Parameters
-
pin | The pin to read from. |
initState | The initial (un-pushed) state of the button. |
Definition at line 45 of file Pins.h.
◆ clicks()
int able::Pin::clicks |
( |
uint8_t |
pressed, |
|
|
uint8_t |
released |
|
) |
| |
|
inlineprotected |
Return the number of clicks.
- Parameters
-
pressed | The pressed state of a button. |
released | The released state of a button. |
- Returns
- Always no clicks (0) as clicks not supported by default.
Definition at line 83 of file Pins.h.
◆ nextId()
static uint8_t able::Pin::nextId |
( |
| ) |
|
|
inlinestaticprotected |
Return the next auto-assigned button identifier.
- Returns
- The next auto-assigned button identifier. Each call increases the auto-assigned identifier.
Definition at line 29 of file Pins.h.
◆ readPin()
void able::Pin::readPin |
( |
| ) |
|
|
inlineprotected |
Read the pin directly.
In order to save memory, virtual functions are not used (which can consume almost 1K of memory to deal with). Runtime polymorphism is not required, so avoiding virtual functions saves memory.
Definition at line 66 of file Pins.h.
◆ autoId_
uint8_t able::Pin::autoId_ = 0 |
|
staticprotected |
Auto-assigned button identifier.
Definition at line 91 of file Pins.h.
◆ currState_
uint8_t able::Pin::currState_ |
|
protected |
The reading of the pin.
Definition at line 94 of file Pins.h.
◆ pin_
The Arduino pin connected to the button.
Definition at line 93 of file Pins.h.
The documentation for this class was generated from the following files: