cleaned up motor class with separate header and .cpp files

Dependencies:   mbed

Dependents:   TerraBot_Drive_2D TerraBot_Drive_2D TerraBot_Drive_2D_FINAL DUMP_TRUCK_Test ... more

Embed: (wiki syntax)

« Back to documentation index

Motor Class Reference

Motor Class Reference

Interface for controlling the dump truck's motors. More...

#include <Motor.h>

Public Member Functions

 Motor (PinName pwm, PinName dir)
 Constructor for the Motor object.
void write (float Val)
 Command the motor to run at a desired speed.
float read ()
 Read the speed of the motor.

Detailed Description

Interface for controlling the dump truck's motors.

Definition at line 21 of file Motor.h.


Constructor & Destructor Documentation

Motor ( PinName  pwm,
PinName  dir 
)

Constructor for the Motor object.

Parameters:
[in]pwmThe PwmOut pin used for controlling speed.
[in]dirThe DigitalOut pin used for controlling direction.

Definition at line 3 of file Motor.cpp.


Member Function Documentation

float read (  )

Read the speed of the motor.

Definition at line 19 of file Motor.cpp.

void write ( float  Val )

Command the motor to run at a desired speed.

Parameters:
[in]ValThe desired speed of type float.

Definition at line 7 of file Motor.cpp.