V1

Dependents:   VITI_motor_angle_1 VITI_motor_angle_2 VITI_motor_angle_3

Embed: (wiki syntax)

« Back to documentation index

Motor Class Reference

Motor Class Reference

Interface to control a standard DC motor. More...

#include <TB6549.h>

Public Member Functions

 Motor (PinName pwm, PinName in1, PinName in2, PinName sb)
 Create a motor control interface.
void speed (float speed)
 Set the speed of the motor.

Detailed Description

Interface to control a standard DC motor.

with an H-bridge using a PwmOut and 3 DigitalOuts

Definition at line 15 of file TB6549.h.


Constructor & Destructor Documentation

Motor ( PinName  pwm,
PinName  in1,
PinName  in2,
PinName  sb 
)

Create a motor control interface.

Parameters:
pwmA PwmOut pin, driving the H-bridge enable line to control the speed
in1A DigitalOut,
in2A DigitalOut,
sbA DigitalOut,

Definition at line 11 of file TB6549.cpp.


Member Function Documentation

void speed ( float  speed )

Set the speed of the motor.

Parameters:
speedThe speed of the motor as a normalised value between -1.0 and 1.0

Definition at line 25 of file TB6549.cpp.