Accessories
Arduino for motors and lights library.
PortTwoPinsEnable.hpp
1 //-------------------------------------------------------------------
2 #ifndef __PortTwoPinsEnable_H__
3 #define __PortTwoPinsEnable_H__
4 //-------------------------------------------------------------------
5 
6 #include "PortTwoPins.hpp"
7 
12 {
13  protected:
18  int pinEnable;
22  PIN_TYPE pinTypeEnable;
23 
24  public:
27 
35  void begin(int inPinA, int inPinB, PIN_TYPE inType, int inPinEnable, PIN_TYPE inTypeEnable);
36 
40  inline int GetPinEnable() const { if (this->GetPinType() < ANALOG) return GPIO_to_Arduino_pin((GPIO_pin_t)this->pinEnable); return this->pinEnable; }
44  inline GPIO_pin_t GetDIOPinEnable() const { if (this->GetPinType() < ANALOG) return (GPIO_pin_t)this->pinEnable; return DP_INVALID; }
45 
49  void MoveLeftDir(unsigned long inDuration = 0);
53  void MoveRightDir(unsigned long inDuration = 0);
55  void MoveStop();
56 
57 #ifdef ACCESSORIES_PRINT_ACCESSORIES
58 
61  void printPort();
62 #endif
63 
64 private:
65  void Move(int inValA, int inValB, int inValEnable);
66 };
67 
68 //-------------------------------------------------------------------
69 #endif
70 //-------------------------------------------------------------------
void MoveRightDir(unsigned long inDuration = 0)
void MoveLeftDir(unsigned long inDuration = 0)
GPIO_pin_t GetDIOPinEnable() const
PIN_TYPE GetPinType() const
Definition: Port.hpp:77
int GetPinEnable() const
virtual void begin()
Definition: Port.hpp:117