Accessories
Arduino for motors and lights library.
PortShieldL293d Class Reference

#include "PortShieldL293d.hpp"

Inheritance diagram for PortShieldL293d:
Port

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 ()
 
- Public Member Functions inherited from Port
 Port ()
 
virtual void begin ()
 
virtual void beginByAccessory (int inStartingPosition)
 
PIN_TYPE GetPinType () const
 
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
 
- Protected Attributes inherited from Port
PIN_TYPE pinType
 
PORT_STATE state
 
int speed
 

Additional Inherited Members

- Protected Member Functions inherited from Port
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
 

Detailed Description

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.

Constructor & Destructor Documentation

PortShieldL293d::PortShieldL293d ( )

Default constructor.

Definition at line 13 of file PortShieldL293d.cpp.

Member Function Documentation

void PortShieldL293d::begin ( unsigned char  inOutPort,
uint8_t  inSpeed,
uint8_t  inFreq 
)

Initialize the instance.

Parameters
inOutPortshield port number, 1 to 4. Use SHIELDL293D_PORT_M* defines.
inSpeedDefault speed.
inFreqFrequencies 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.

void PortShieldL293d::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 Port.

Definition at line 38 of file PortShieldL293d.cpp.

void PortShieldL293d::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 Port.

Definition at line 61 of file PortShieldL293d.cpp.

void PortShieldL293d::MoveStop ( )
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.

Parameters
inSpeednew current speed of the port.
Returns
Previous speed.

Definition at line 31 of file PortShieldL293d.cpp.

Member Data Documentation

AF_DCMotor* PortShieldL293d::pmotor
protected

Instance of the AF_Motor class.

Definition at line 31 of file PortShieldL293d.hpp.


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