Michael Dushkoff / mMotor

Dependents:   RaceTimer

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mMotor.h Source File

mMotor.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * This is a stepper motor library for testing       *
00003  * 4 step stepper motors.  The speed of stepping is  *
00004  * variable as well as the amount of steps.          *
00005  * ------------------------------------------------- *
00006  * This library is based on the sMotor library by    *
00007  * Samuel Matildes (sam.naeec@gmail.com).            *
00008  * ------------------------------------------------- *
00009  *                                                   *
00010  * Created by: Michael Dushkoff (mad1841@rit.edu)    *
00011  * * * * * * * * * * * * * * * * * * * * * * * * * * */
00012 
00013 #ifndef MBED_MSTEPMOTOR_H
00014 #define MBED_MSTEPMOTOR_H
00015  
00016 #include "mbed.h"
00017 
00018 class mMotor {
00019 public:
00020 
00021     mMotor(PinName M0, PinName M1, PinName M2, PinName M3); //motor constructor
00022 
00023     /* Low Torque mode */
00024     void step(int num_steps, int direction, int speed);
00025     void counterclockwise();
00026     void clockwise();
00027     
00028     /* High Torque mode */
00029     void ht_step(int num_steps, int direction, int speed);
00030     void ht_counterclockwise();
00031     void ht_clockwise();
00032 
00033 
00034 private:
00035 
00036     DigitalOut _M0;
00037     DigitalOut _M1;
00038     DigitalOut _M2;
00039     DigitalOut _M3;
00040 
00041 };
00042 
00043 #endif