QPIDfirmware  v0.1
Object oriented firmware for autonomous motor drivers with encoder based PID controller and flexible interface
QPID_Endstop Class Reference

Abstract class for any kind of endstop switch. More...

Inheritance diagram for QPID_Endstop:

Public Member Functions

virtual bool isOn ()
 true if switch currently activated More...
 
- Public Member Functions inherited from QPID_Object
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
 
- Protected Member Functions inherited from QPID_Object
 QPID_Object ()
 Constructor. Begins Serial with 115200 baud for logging and error reporting, if not done previously.
 

Detailed Description

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.

Member Function Documentation

◆ isOn()

bool QPID_Endstop::isOn ( )
virtual

true if switch currently activated

Dummy implementation. Acts as if there's no endstop by always returning false.

Returns
Always false.

Reimplemented in QPID_Endstop_PinSharedAnalog, and QPID_Endstop_Digital.


The documentation for this class was generated from the following files: