Commanders
Arduino buttons/bus library
ButtonsCommanderSwitchOnePin Class Reference

#include "ButtonsCommanderSwitchOnePin.hpp"

Inheritance diagram for ButtonsCommanderSwitchOnePin:
ButtonsCommanderButton

Public Member Functions

 ButtonsCommanderSwitchOnePin ()
 
void begin (unsigned long inId, int inPin)
 
void beforeFirstLoop ()
 
unsigned long loop ()
 
- Public Member Functions inherited from ButtonsCommanderButton
 ButtonsCommanderButton (unsigned long inId)
 
unsigned long GetId () const
 
virtual ButtonsCommanderButton * GetFromId (unsigned long inId)
 
virtual int GetPosition () const
 
virtual void EndLoop ()
 
void SetNextButton (ButtonsCommanderButton *inpButton)
 
ButtonsCommanderButton * GetNextButton () const
 

Additional Inherited Members

- Protected Attributes inherited from ButtonsCommanderButton
unsigned long Id
 

Detailed Description

A switch can be used in a On/Off way. In this case only one Arduino pin is connected to the switch. The event raised is always of type COMMANDERS_EVENT_MOVE and data is COMMANDERS_MOVE_ON or COMMANDERS_MOVE_OFF.

Events thrown:

reason id type data
pin state to HIGH button id COMMANDERS_EVENT_MOVE COMMANDERS_MOVE_ON
pin state to LOW button id COMMANDERS_EVENT_MOVE COMMANDERS_MOVE_OFF

Definition at line 20 of file ButtonsCommanderSwitchOnePin.hpp.

Constructor & Destructor Documentation

ButtonsCommanderSwitchOnePin::ButtonsCommanderSwitchOnePin ( )

Default constructor.

Definition at line 11 of file ButtonsCommanderSwitchOnePin.cpp.

Member Function Documentation

void ButtonsCommanderSwitchOnePin::beforeFirstLoop ( )
virtual

This function will be called after sketch Setup(), but before the first call to loop(). It will be called only one time.

Reimplemented from ButtonsCommanderButton.

Definition at line 26 of file ButtonsCommanderSwitchOnePin.cpp.

void ButtonsCommanderSwitchOnePin::begin ( unsigned long  inId,
int  inPin 
)

Initialize the instance.

Parameters
inIdid of the button.
inPinArduino pin connected to the switch button.

Definition at line 18 of file ButtonsCommanderSwitchOnePin.cpp.

unsigned long ButtonsCommanderSwitchOnePin::loop ( )
virtual

Main loop function.

Reimplemented from ButtonsCommanderButton.

Definition at line 37 of file ButtonsCommanderSwitchOnePin.cpp.


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