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...
|
|
|
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.
◆ 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 62 of file Pins.h.
◆ autoId_
uint8_t able::Pin::autoId_ = 0 |
|
staticprotected |
Auto-assigned button identifier.
Definition at line 70 of file Pins.h.
◆ currState_
uint8_t able::Pin::currState_ |
|
protected |
The reading of the pin.
Definition at line 73 of file Pins.h.
◆ pin_
The Arduino pin connected to the button.
Definition at line 72 of file Pins.h.
The documentation for this class was generated from the following files: