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

Constructor & Destructor Documentation

ButtonsCommanderSwitchOnePin::ButtonsCommanderSwitchOnePin ( )

Default constructor.

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.

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

Initialize the instance.

Parameters
inIdid of the button.
inPinArduino pin connected to the switch button.
unsigned long ButtonsCommanderSwitchOnePin::loop ( )
virtual

Main loop function.

Reimplemented from ButtonsCommanderButton.


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