#include "AccessoryMotorOneWay.hpp"
Public Member Functions | |
AccessoryMotorOneWay () | |
![]() | |
AccessoryMotor () | |
bool | ActionEnded () |
bool | IsLeft () const |
bool | IsRight () const |
bool | IsStopped () const |
void | begin (Port *inpPort, unsigned long inId, int inSpeed, unsigned long inDurationMilli = 0) |
void | Event (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
int | EEPROMLoad (int inPos) |
void | Move (unsigned long inId) |
virtual void | MoveLeft (unsigned long inDuration = 0, int inSpeed = 0) |
virtual void | MoveStop () |
void | ExternalMove (ACC_STATE inNewState) |
![]() | |
Accessory () | |
void | begin (ACC_STATE inStartingState = STATE_NONE) |
Port * | GetPort () const |
ACC_STATE | GetState () const |
ACC_STATE | GetPreviousState () const |
bool | IsNone () const |
bool | IsFirst () const |
bool | IsSecond () const |
unsigned int | GetDebounceDelay () const |
unsigned long | GetLastMoveTime () const |
unsigned long | GetDuration () const |
bool | loop () |
virtual int | EEPROMSave (int inPos, bool inSimulate = false) |
uint8_t | AddMovingPosition (unsigned long inId, int inPosition) |
uint8_t | AddMovingPositions (const MovingPosition *inMovingPositions_P) |
void | AdjustMovingPositionsSize (uint8_t inNewSize) |
bool | IsEmpty () const |
uint8_t | IndexOfMovingPositionById (unsigned long inId) const |
int | GetMovingPositionValueById (unsigned long inId) const |
int | GetMovingPositionValueByIndex (uint8_t inIndex) const |
unsigned long | GetMovingPositionIdByIndex (uint8_t inIndex) const |
const uint8_t | GetLastMovingPosition () const |
const uint8_t | GetMovingPositionSize () const |
void | SetLastMovingPosition (uint8_t inLastPositionIndex) |
void | SetDebounceDelay (unsigned int inDebounceDelay) |
void | SetLastMoveTime () |
void | SetDuration (unsigned long inDuration) |
void | SetNextAccessory (Accessory *inAccessory) |
Accessory * | GetNextAccessory () const |
unsigned long | GetActionStartingMillis () const |
virtual void | StartAction () |
virtual void | StartAction (ACC_STATE inState) |
virtual void | ResetAction () |
bool | IsActionDelayPending () const |
virtual bool | IsGroupActionPending () const |
virtual bool | CanBePositional () const |
virtual void | MovePosition (int inPosition) |
void | SetStateRaw (ACC_STATE inNewState) |
void | SetStartingMillis () |
void | ResetStartingMillis () |
Protected Member Functions | |
void | MoveRight (unsigned long inDuration = 0, int inSpeed = 0) |
ACC_STATE | MoveToggle (unsigned long inDuration = 0, int inSpeed = 0) |
![]() | |
void | SetState (ACC_STATE instate) |
ACC_STATE | Toggle () |
Additional Inherited Members | |
![]() | |
static void | ExecuteEvent (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent = ACCESSORIES_EVENT_MOVEPOSITIONID, int inData = 0) |
static uint8_t | GetCount () |
static bool | IsActionPending () |
static Accessory * | GetFirstAccessory () |
![]() | |
Port * | pPort |
ACC_STATE | prevState |
This class describes a motor with only one moving direction : uncoupling motor, rotating motor for windmill sails...
Events handled:
id | type | data | effect |
---|---|---|---|
motor id | ACCESSORIES_EVENT_TOGGLE | Moves the motor... | |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_STRAIGHT | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_TOP | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_LEFT | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_DIVERGE | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_BOTTOM | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_RIGHT | Moves the motor... |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_STOP | Stops the motor. |
motor id | ACCESSORIES_EVENT_MOVE | ACCESSORIES_MOVE_OFF | Stops the motor. |
motor id | ACCESSORIES_EVENT_MOVEPOSITION | New state | Change the current state of the object. |
motor position id | ACCESSORIES_EVENT_MOVEPOSITIONID | Use the id to reach this moving position | |
motor position id | ACCESSORIES_EVENT_MOVEPOSITIONINDEX | Index | Use the index to reach this moving position |
motor id | ACCESSORIES_EVENT_SETSPEED | New speed | Change the current speed. |
motor id | ACCESSORIES_EVENT_SETDURATION | New duration | Change the current duration. 0 for continual movement. |
motor id | ACCESSORIES_EVENT_EXTERNALMOVE | New state | Change the current state of the object, without doing any movement on the real motor. |
Definition at line 33 of file AccessoryMotorOneWay.hpp.
|
inline |
Default constructor.
Definition at line 37 of file AccessoryMotorOneWay.hpp.
|
inlineprotectedvirtual |
Move the motor... There is only one direction, so MoveLeft() will do the same movement than MoveRight() !
[in] | inDuration | Duration of the movement. If 0, the movement will not stop until a MoveStop(). Default is 0. |
[in] | inSpeed | speed for this movement. This speed becomes the default speed for next movements. If 0, the speed is not updated. Default is 0. |
Reimplemented from AccessoryMotor.
Definition at line 44 of file AccessoryMotorOneWay.hpp.
|
inlineprotectedvirtual |
Change the direction. Huh ? There is only one direction ? OK, change the direction to ... the same !
[in] | inDuration | Duration of the movement. If 0, the movement will not stop until a MoveStop(). Default is 0. |
[in] | inSpeed | speed for this movement. This speed becomes the default speed for next movements. If 0, the speed is not updated. Default is 0. |
Implements AccessoryMotor.
Definition at line 51 of file AccessoryMotorOneWay.hpp.