![]() |
QPIDfirmware
v0.1
Object oriented firmware for autonomous motor drivers with encoder based PID controller and flexible interface
|
Abstract class for any kind of endstop switch. More...
Public Member Functions | |
virtual bool | isOn () |
true if switch currently activated 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... | |
Protected Member Functions | |
virtual bool | processMessage (uint8_t *m) |
(abstract) Interprets message handed down from QPID_Unit locally. Must be overridden in derived classes | |
![]() | |
QPID_Object () | |
Constructor. Begins Serial with 115200 baud for logging and error reporting, if not done previously. | |
Abstract class for any kind of endstop switch.
Making this a class might seem overly complicated. However, it enables the QPID system to work with more sophisticated hardware setups, e.g. switches on an I2C port expander, or pin sharing using a resistor array on an anolog input pin. It could also be used to implement debouncing, hysteresis and other fancy stuff.
|
virtual |
true if switch currently activated
Dummy implementation. Acts as if there's no endstop by always returning false.
Reimplemented in QPID_Endstop_PinSharedAnalog, and QPID_Endstop_Digital.