#include "PortShieldL293d.hpp"
Public Member Functions | |
PortShieldL293d () | |
void | begin (unsigned char inOutPort, uint8_t inSpeed, uint8_t inFreq) |
int | SetSpeed (uint8_t inSpeed) |
void | MoveLeftDir (unsigned long inDuration = 0) |
void | MoveRightDir (unsigned long inDuration = 0) |
void | MoveStop () |
![]() | |
Port () | |
virtual void | begin () |
virtual void | beginByAccessory (int inStartingPosition) |
PORT_STATE | GetState () const |
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 | |
AF_DCMotor * | pmotor |
![]() | |
PIN_TYPE | pinType |
PORT_STATE | state |
int | speed |
Additional Inherited Members | |
![]() | |
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 |
This class is dedicated to the L293D shield for Arduino. This shield have fix pins and use a specific version of the class AF_DCMotor to work. This file is extracted from an old library called AF_Motor, discontinued and deprecated because of a new hardware model of the shield working with I2C...
Definition at line 27 of file PortShieldL293d.hpp.
PortShieldL293d::PortShieldL293d | ( | ) |
Default constructor.
Definition at line 13 of file PortShieldL293d.cpp.
void PortShieldL293d::begin | ( | unsigned char | inOutPort, |
uint8_t | inSpeed, | ||
uint8_t | inFreq | ||
) |
Initialize the instance.
inOutPort | shield port number, 1 to 4. Use SHIELDL293D_PORT_M* defines. |
inSpeed | Default speed. |
inFreq | Frequencies for port number 1 & 2 are MOTOR12_64KHZ, MOTOR12_8KHZ, MOTOR12_2KHZ, MOTOR12_1KHZ, Frequencies for port number 3 & 4 are MOTOR34_64KHZ, MOTOR34_8KHZ, MOTOR34_1KHZ |
Definition at line 17 of file PortShieldL293d.cpp.
|
virtual |
Sets the current state of the port to PORT_LEFT.
inDuration | the pins will be activated to left for the given delay. |
Reimplemented from Port.
Definition at line 38 of file PortShieldL293d.cpp.
|
virtual |
Sets the current state of the port to PORT_RIGHT.
inDuration | the pins will be activated to right for the given delay. |
Reimplemented from Port.
Definition at line 61 of file PortShieldL293d.cpp.
|
virtual |
Sets the current state of the port to PORT_STOP.
Reimplemented from Port.
Definition at line 85 of file PortShieldL293d.cpp.
int PortShieldL293d::SetSpeed | ( | uint8_t | inSpeed | ) |
Sets the current speed of the port.
inSpeed | new current speed of the port. |
Definition at line 31 of file PortShieldL293d.cpp.
|
protected |
Instance of the AF_Motor class.
Definition at line 31 of file PortShieldL293d.hpp.