Motor class for the robot

Dependencies:   mbed

Dependents:   TEST_ENCODER

Embed: (wiki syntax)

« Back to documentation index

Motorslam Class Reference

Motorslam Class Reference

Interface created to control left and right motors of SLAM robot TB6612FNG is the motor driver(H-bridge,dual motor driver) More...

#include <Motorslam.h>

Public Member Functions

 Motorslam (PinName pinPwmLeft, PinName pinLeftIn1, PinName pinLeftIn2, PinName pinPwmRight, PinName pinRightIn1, PinName pinRightIn2, PinName pinNStby)
 Create an interface to connect TB6612FNG with mbed LPC1768.
void init ()
 Set the speed of the motor.

Detailed Description

Interface created to control left and right motors of SLAM robot TB6612FNG is the motor driver(H-bridge,dual motor driver)

Definition at line 19 of file Motorslam.h.


Constructor & Destructor Documentation

Motorslam ( PinName  pinPwmLeft,
PinName  pinLeftIn1,
PinName  pinLeftIn2,
PinName  pinPwmRight,
PinName  pinRightIn1,
PinName  pinRightIn2,
PinName  pinNStby 
)

Create an interface to connect TB6612FNG with mbed LPC1768.

Parameters:
pwmLeft,PWMoutput from mbed is channelled to Left Motor to control speed
leftIn1,DigitalOut1pin of mbed set to HIGH(1) to move motor forward
leftIn2,DigitalOut2pin of mbed set to HIGH(1) to move motor backwards

Definition at line 8 of file Motorslam.cpp.


Member Function Documentation

void init (  )

Set the speed of the motor.

Parameters:
speedThe speed of the motor is normalised between -1.0 and 1.0

Definition at line 31 of file Motorslam.cpp.