Accessories
Arduino for motors and lights library.
PortShieldL293d.hpp
1 //-------------------------------------------------------------------
2 #ifndef __PortShieldL293d_H__
3 #define __PortShieldL293d_H__
4 //-------------------------------------------------------------------
5 
6 #if !defined(__AVR_ATmega32U4__)
7 #if defined VISUALSTUDIO
8 #include "AFMotor.h"
9 #else
10 #include "AFMotor.hpp"
11 #endif
12 #include "Port.hpp"
13 
14 #define SHIELDL293D_PORT_M1 1
15 #define SHIELDL293D_PORT_M2 2
16 #define SHIELDL293D_PORT_M3 3
17 #define SHIELDL293D_PORT_M4 4
18 
19 #define SHIELDL293D_SERVO1_PIN 10
20 #define SHIELDL293D_SERVO2_PIN 9
21 
27 class PortShieldL293d : public Port
28 {
29  protected:
31  AF_DCMotor *pmotor;
32 
33  public:
36 
43  void begin(unsigned char inOutPort, uint8_t inSpeed, uint8_t inFreq);
44 
49  int SetSpeed(uint8_t inSpeed);
50 
54  void MoveLeftDir(unsigned long inDuration = 0);
58  void MoveRightDir(unsigned long inDuration = 0);
60  void MoveStop();
61 
62 #ifdef ACCESSORIES_PRINT_ACCESSORIES
63 
64  unsigned char printedOutPort;
66  uint8_t printedSpeed;
70  void printPort();
71 #endif
72 };
73 
74 //-------------------------------------------------------------------
75 #endif
76 #endif
77 //-------------------------------------------------------------------
void MoveLeftDir(unsigned long inDuration = 0)
int SetSpeed(uint8_t inSpeed)
virtual void begin()
Definition: Port.hpp:99
AF_DCMotor * pmotor
void MoveRightDir(unsigned long inDuration = 0)
Definition: Port.hpp:61