![]() |
InputEvents v1.6.0
An easy to use but comprehensive Event Library for Buttons, Encoders, Encoder Buttons, Analog Inputs, Joysticks and Switches.
|
Implementation of a PinAdapter that reads from a GpioExpanderAdapter.
#include <ExpanderPinAdapter.h>

Public Member Functions | |
| ExpanderPinAdapter (byte pin, GpioExpanderAdapter &expander, int mode=INPUT_PULLUP) | |
| Construct a new ExpanderPinAdapter with a GpioExpanderAdapter and optional pin mode (default INPUT_PULLUP) More... | |
| void | begin () override |
| Attach the pin to the GpioExpanderAdapter which will set the pinMode if required/possible. More... | |
| bool | read () override |
| Return the state of this pin. If the GpioPinAdapter does not exist will return 'OFF' state (this should never happen!) More... | |
| virtual void | begin ()=0 |
| Initialise the pin adapter. Must be safe for repeated calls (Idempotent) More... | |
| virtual bool | read ()=0 |
| Read the current state of the pin. More... | |
|
inline |
Construct a new ExpanderPinAdapter with a GpioExpanderAdapter and optional pin mode (default INPUT_PULLUP)
| pin | The pin number |
| expander | Passed by reference because the GpioExpanderAdapter::update() is always called from loop() or interrupt |
| mode | The pin mode. Not all GpioExpanderAdapters support setting pinMode but should be set to reflect the physical wiring on the pin. |
|
inlineoverridevirtual |
Attach the pin to the GpioExpanderAdapter which will set the pinMode if required/possible.
This has to be separate from instance creation because of Arduino timing requirements (pins may not be ready when instance is created)
Implements PinAdapter.
|
inlineoverridevirtual |
Return the state of this pin. If the GpioPinAdapter does not exist will return 'OFF' state (this should never happen!)
Implements PinAdapter.