Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
Generated on Fri Jul 15 2022 07:28:44 by
1.7.2