Accessories
Arduino for motors and lights library.
PortTwoPinsEnable Class Reference

#include "PortTwoPinsEnable.hpp"

Inheritance diagram for PortTwoPinsEnable:
PortTwoPins Port

Public Member Functions

 PortTwoPinsEnable ()
 
void begin (int inPinA, int inPinB, PIN_TYPE inType, int inPinEnable, PIN_TYPE inTypeEnable)
 
int GetPinEnable () const
 
GPIO_pin_t GetDIOPinEnable () const
 
void MoveLeftDir (unsigned long inDuration = 0)
 
void MoveRightDir (unsigned long inDuration = 0)
 
void MoveStop ()
 
- Public Member Functions inherited from PortTwoPins
 PortTwoPins ()
 
void begin (int inPinA, int inPinB, PIN_TYPE inType)
 
bool IsActive () const
 
int GetPinA () const
 
GPIO_pin_t GetDIOPinA () const
 
int GetPinB () const
 
GPIO_pin_t GetDIOPinB () const
 
- Public Member Functions inherited from Port
PIN_TYPE GetPinType () const
 
PORT_STATE GetPortState () const
 
void SetPinType (PIN_TYPE inType)
 
void SetPortState (PORT_STATE inState)
 
int MapValue (int inValue, PIN_TYPE inType = UNDEFINED) const
 
int beginPin (int inPin, PIN_TYPE inType = UNDEFINED) const
 
void MovePin (int inPin, int inValue, PIN_TYPE inType = UNDEFINED) const
 
 Port ()
 
virtual void begin ()
 
virtual void beginByAccessory (int inStartingPosition)
 
int GetSpeed () const
 
virtual int SetSpeed (int inSpeed)
 
bool IsLeftDir () const
 
bool IsRightDir () const
 
bool IsStopped () const
 
void MoveLeftDir (unsigned long inDuration, int inSpeed)
 
void MoveRightDir (unsigned long inDuration, int inSpeed)
 
PORT_STATE MoveToggle (unsigned long inDuration = 0)
 
virtual void MovePosition (unsigned long inDuration, int inEndPosition)
 
virtual int GetPosition ()
 

Protected Attributes

int pinEnable
 
PIN_TYPE pinTypeEnable
 
- Protected Attributes inherited from PortTwoPins
int pinA
 
int pinB
 
- Protected Attributes inherited from Port
int speed
 
byte type_state
 

Detailed Description

This class describes a variant or the PortTwoPins class. There is the two originals pins from the base class, but there is also a new pin to enable the full port.

Definition at line 11 of file PortTwoPinsEnable.hpp.

Constructor & Destructor Documentation

PortTwoPinsEnable::PortTwoPinsEnable ( )

Default constructor.

Definition at line 9 of file PortTwoPinsEnable.cpp.

Member Function Documentation

void PortTwoPinsEnable::begin ( int  inPinA,
int  inPinB,
PIN_TYPE  inType,
int  inPinEnable,
PIN_TYPE  inTypeEnable 
)

Initialize the instance.

Parameters
inPinAfirst pin to drive.
inPinBsecond pin to drive.
inTypekind of both pins.
inPinEnableenable pin.
inTypeEnablekind of enable pin.

Definition at line 13 of file PortTwoPinsEnable.cpp.

GPIO_pin_t PortTwoPinsEnable::GetDIOPinEnable ( ) const
inline

Gets the enable pin.

Returns
Pin A number in DIO2 mode.

Definition at line 44 of file PortTwoPinsEnable.hpp.

int PortTwoPinsEnable::GetPinEnable ( ) const
inline

Gets the enable pin.

Returns
pin number in Arduino mode.

Definition at line 40 of file PortTwoPinsEnable.hpp.

void PortTwoPinsEnable::MoveLeftDir ( unsigned long  inDuration = 0)
virtual

Sets the current state of the port to PORT_LEFT.

Parameters
inDurationthe pins will be activated to left for the given delay.

Reimplemented from PortTwoPins.

Definition at line 23 of file PortTwoPinsEnable.cpp.

void PortTwoPinsEnable::MoveRightDir ( unsigned long  inDuration = 0)
virtual

Sets the current state of the port to PORT_RIGHT.

Parameters
inDurationthe pins will be activated to right for the given delay.

Reimplemented from PortTwoPins.

Definition at line 52 of file PortTwoPinsEnable.cpp.

void PortTwoPinsEnable::MoveStop ( )
virtual

Sets the current state of the port to PORT_STOP.

Reimplemented from PortTwoPins.

Definition at line 81 of file PortTwoPinsEnable.cpp.

Member Data Documentation

int PortTwoPinsEnable::pinEnable
protected

Enable pin of this port. ANALOG or ANALOG_INVERTED : Classic Arduino pin number DIGITAL or DIGITAL_INVERTED : GPIO_pin_t casted in an integer.

Definition at line 18 of file PortTwoPinsEnable.hpp.

PIN_TYPE PortTwoPinsEnable::pinTypeEnable
protected

Enable pin type. In case of ANALOG or ANALOG_INVERTED this pin is used to give the PWM speed.

Definition at line 22 of file PortTwoPinsEnable.hpp.


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