Implements the simplest form of endstop using a digital input pin.
More...
#include <QPID_Endstop_Digital.h>
|
bool | isOn () |
| returns true if switch is currently activated
|
|
void | init (int8_t switchPin, bool useInternalPullup, bool activeHigh) |
| Initialises the endstop with given parameters. Needs be called first before using the object. More...
|
|
virtual void | update () |
| (abstract) Can be overridden by QPID subsystems which need to do their own polling. Will be called by QPID_Unit::update() for subsystems, and by firmware/client for QPID_Unit itself.
|
|
void | throwError (const char *invokedBy, const char *errorMessage) |
| Writes error message and error invoking class to Serial. More...
|
|
void | log (const char *logEntry) |
| Puts timestamped string into the system log (atm: writes it out to Serial). More...
|
|
|
static const int8_t | msgInit = 0x01 |
|
static const int8_t | msgInitLen = 3 + messageLenOverhead |
|
|
bool | processMessage (uint8_t *m) override |
| Interprets messages specific for this class. More...
|
|
| QPID_Object () |
| Constructor. Begins Serial with 115200 baud for logging and error reporting, if not done previously.
|
|
Implements the simplest form of endstop using a digital input pin.
- Todo:
- check private, protected etc. for all dervide classes
◆ init()
void QPID_Endstop_Digital::init |
( |
int8_t |
switchPin, |
|
|
bool |
useInternalPullup, |
|
|
bool |
activeHigh |
|
) |
| |
Initialises the endstop with given parameters. Needs be called first before using the object.
- Parameters
-
switchPin | digital input pin |
useInternalPullup | well... |
activeHigh | true if active switch will pull input HIGH, false if LOW |
◆ processMessage()
bool QPID_Endstop_Digital::processMessage |
( |
uint8_t * |
m | ) |
|
|
overrideprotectedvirtual |
Interprets messages specific for this class.
- Parameters
-
- Returns
- true if correct command was found and executed
Reimplemented from QPID_Endstop.
The documentation for this class was generated from the following files: