Commanders
Arduino buttons/bus library
|
#include "ButtonsCommanderButton.hpp"
Public Member Functions | |
ButtonsCommanderButton (unsigned long inId) | |
unsigned long | GetId () const |
virtual ButtonsCommanderButton * | GetFromId (unsigned long inId) |
virtual int | GetPosition () const |
virtual void | beforeFirstLoop () |
virtual unsigned long | loop () |
virtual void | EndLoop () |
void | SetNextButton (ButtonsCommanderButton *inpButton) |
ButtonsCommanderButton * | GetNextButton () const |
Protected Attributes | |
unsigned long | Id |
A button is a hardware device allowing user to act when this device is used. Its id is sent, and the listener of the commander events can do the job.
This is the base class for all buttons, this class should not be instantiate !
ButtonsCommanderButton::ButtonsCommanderButton | ( | unsigned long | inId | ) |
Default constructor.
inId | each button can be identified by at least one id. |
|
inlinevirtual |
This function will be called after sketch Setup(), but before the first call to loop(). It will be called only one time.
Reimplemented in ButtonsCommanderSwitch, ButtonsCommanderSwitchTwoPins, and ButtonsCommanderSwitchOnePin.
|
inlinevirtual |
Reinitialize the button for future use. Called at the end of the loop, if an event has been raised.
Reimplemented in ButtonsCommanderAnalogPushes.
|
inlinevirtual |
Gets the button's address from its id.
inId | id to find. |
Reimplemented in ButtonsCommanderAnalogPushes.
|
inline |
Gets the button's id.
|
inline |
Gets the next button of 'this' in the linked list.
|
inlinevirtual |
Gets the current position of the button. Only possible on analog buttons like potentiometers or encoders.
Reimplemented in ButtonsCommanderEncoder, and ButtonsCommanderPotentiometer.
|
inlinevirtual |
Main loop function.
Reimplemented in ButtonsCommanderAnalogPushes, ButtonsCommanderEncoder, ButtonsCommanderPush, ButtonsCommanderSwitch, ButtonsCommanderSwitchTwoPins, ButtonsCommanderPotentiometer, and ButtonsCommanderSwitchOnePin.
|
inline |
Adds a new button at the end of the button linked list.
inpButton | new button to add. |
|
protected |
Id of this button. This id should be unique !