Commanders
Arduino buttons/bus library
Events.h File Reference

Events which can be thrown.

Go to the source code of this file.

Macros

#define UNDEFINED_ID   ((unsigned long)-1)
 

Enums

enum  COMMANDERS_MOVE_TYPE {
  COMMANDERS_MOVE_MORE = +1, COMMANDERS_MOVE_LESS = -1, COMMANDERS_MOVE_STOP = 0, COMMANDERS_MOVE_LEFT = -2,
  COMMANDERS_MOVE_RIGHT = -3, COMMANDERS_MOVE_CENTER = -4, COMMANDERS_MOVE_TOP = -5, COMMANDERS_MOVE_BOTTOM = -6,
  COMMANDERS_MOVE_STRAIGHT = -7, COMMANDERS_MOVE_DIVERGE = -8, COMMANDERS_MOVE_ON = -9, COMMANDERS_MOVE_OFF = -10
}
 
enum  COMMANDERS_EVENT_TYPE {
  COMMANDERS_EVENT_NONE = 0, COMMANDERS_EVENT_TOGGLE = 1, COMMANDERS_EVENT_MOVE = 2, COMMANDERS_EVENT_MOVEPOSITION = 3,
  COMMANDERS_EVENT_MOVEPOSITIONINDEX = 4, COMMANDERS_EVENT_MOVEPOSITIONID = 5, COMMANDERS_EVENT_CONFIG = 6
}
 

Macro Definition Documentation

#define UNDEFINED_ID   ((unsigned long)-1)

Undefined id ! Used by all loop() functions if no event has been detected.

Enumeration Type Documentation

Describes the main events thrown by Commanders.

Enum ValuesDocumentation
COMMANDERS_EVENT_NONE 

Should never appear.

COMMANDERS_EVENT_TOGGLE 

If a push button or similar is pressed, invert the state/position.

COMMANDERS_EVENT_MOVE 

If a push 'left' button or similar is pressed, data is a COMMANDERS_MOVE_TYPE.

COMMANDERS_EVENT_MOVEPOSITION 

Move to a given position value given by data.

COMMANDERS_EVENT_MOVEPOSITIONINDEX 

Move to an indexed position from pMovingPosition given by data.

COMMANDERS_EVENT_MOVEPOSITIONID 

Move to an identified position from pMovingPosition, given by the event id.

COMMANDERS_EVENT_CONFIG 

Data is the configuration address and value.

Describes the associated data with some particular cases of event type COMMANDERS_EVENT_MOVE. These values will be interpreted by the receiving object. Some values could not have meaning in the context...

Enum ValuesDocumentation
COMMANDERS_MOVE_MORE 

Add an incremental value, like an encoder can do.

COMMANDERS_MOVE_LESS 

Subtract an incremental value, like an encoder can do.

COMMANDERS_MOVE_STOP 

Stop the current movement.

COMMANDERS_MOVE_LEFT 

Move to left side.

COMMANDERS_MOVE_RIGHT 

Move to right side.

COMMANDERS_MOVE_CENTER 

Move to center.

COMMANDERS_MOVE_TOP 

Move to top.

COMMANDERS_MOVE_BOTTOM 

Move to bottom.

COMMANDERS_MOVE_STRAIGHT 

Set the turnout to straight position.

COMMANDERS_MOVE_DIVERGE 

Set the turnout to deviated position.

COMMANDERS_MOVE_ON 

Set accessory on.

COMMANDERS_MOVE_OFF 

Set accessory off.