#include "Commanders.hpp"
Static Public Member Functions | |
static void | begin (int inStatusLedPin = -1, unsigned int inBlinkDelay = 1000) |
static void | begin (CommandersEventHandlerFunction func, int inStatusLedPin = -1, unsigned int inBlinkDelay = 1000) |
static unsigned long | loop () |
static COMMANDERS_EVENT_TYPE | GetLastEventType () |
static int | GetLastEventData () |
static void | SetLastEventType (COMMANDERS_EVENT_TYPE inEvent) |
static void | SetLastEventData (int inData) |
static uint8_t | GetLastConfigAddress () |
static void | StatusBlink () |
static unsigned long | RaiseEvent (unsigned long inId, COMMANDERS_EVENT_TYPE inEvent = COMMANDERS_EVENT_MOVEPOSITIONID, int inData = 0) |
static void | printEventMoveType (COMMANDERS_MOVE_TYPE inMoveType) |
static void | printEventData (COMMANDERS_EVENT_TYPE inEventType, int inEventData) |
static void | printEventType (COMMANDERS_EVENT_TYPE inEventType, bool inDataFollow) |
static void | printEvent (unsigned long inId, COMMANDERS_EVENT_TYPE inEventType, int inEventData) |
Static Public Attributes | |
static GPIO_pin_t | StatusLedPin = DP_INVALID |
static unsigned int | BlinkDelay = 1000 |
This is the main class of the library. All data and functions are static. There is no way to instantiate this class.
To handle events from external hardware of buses, there is two ways:
An event handler can be defined. This function will be called as soon as an event is thrown by any commander. The second way is to get event id, type and data from the Commanders.loop() function inside the main loop of the sketch.
The two ways cannot be used together...
Definition at line 22 of file Commanders.hpp.
|
inlinestatic |
Initialize the instance.
inStatusLedPin | This pin will start to blink at each event thrown. Default -1 for no status led. |
inBlinkDelay | Blinking delay for the status led. Default is 1000ms. |
Definition at line 41 of file Commanders.hpp.
|
inlinestatic |
Initialize the instance.
func | Event handler function called when an event is thrown. |
inStatusLedPin | This pin will start to blink at each event thrown. Default -1 for no status led. |
inBlinkDelay | Blinking delay for the status led. Default is 1000ms. |
Definition at line 65 of file Commanders.hpp.
|
inlinestatic |
Get the last config address used.
Definition at line 98 of file Commanders.hpp.
|
inlinestatic |
Get the last event data thrown.
Definition at line 84 of file Commanders.hpp.
|
inlinestatic |
Get the last event type thrown.
Definition at line 80 of file Commanders.hpp.
|
static |
Main loop function. This function will call all necessary internal loop functions for each commander activated...
Definition at line 125 of file Commanders.cpp.
|
static |
Print on the console the given event in plain English.
|
static |
Print on the console the given associated data.
|
static |
Print on the console the given moving type in plain English.
|
static |
Print on the console the given type in plain English.
|
static |
Raise a new event.
inId | Id of the new event. |
inEvent | Type of the new event. Default is COMMANDERS_EVENT_MOVEPOSITIONID. |
inData | Associated data to the event type. Default is 0. |
Definition at line 27 of file Commanders.cpp.
|
inlinestatic |
Force the data associated with the last event type.
Definition at line 93 of file Commanders.hpp.
|
inlinestatic |
Force the kind of last event type.
inEvent | New event type. |
Definition at line 89 of file Commanders.hpp.
|
static |
Start blinking the status led.
Definition at line 18 of file Commanders.cpp.
|
static |
Blinking delay for the status led.
Definition at line 35 of file Commanders.hpp.
|
static |
This pin will start to blink at each event thrown.
Definition at line 33 of file Commanders.hpp.