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

Implements the simplest form of endstop using a digital input pin. More...

#include <QPID_Endstop_Digital.h>

Inheritance diagram for QPID_Endstop_Digital:

Public Member Functions

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...
 
- 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...
 

Static Public Attributes

static const int8_t msgInit = 0x01
 
static const int8_t msgInitLen = 3 + messageLenOverhead
 

Protected Member Functions

bool processMessage (uint8_t *m) override
 Interprets messages specific for this class. More...
 
- 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

Implements the simplest form of endstop using a digital input pin.

Todo:
check private, protected etc. for all dervide classes

Member Function Documentation

◆ 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
switchPindigital input pin
useInternalPullupwell...
activeHightrue 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
mPointer to message
Returns
true if correct command was found and executed

Reimplemented from QPID_Endstop.


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