Dagozilla to RoboCup / StepperTB

Dependents:   StepperTB_Example Lowlevel_function

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers StepperTB.h Source File

StepperTB.h

00001 #ifndef STEPPERTB_H
00002 #define STEPPERTB_H
00003 
00004 #include "mbed.h"
00005 
00006 class StepperTB {
00007     public:
00008     /*Parameterized CTOR
00009     *ENA = ENA-
00010     *DIR = DIR-
00011     *PUL = PUL-
00012     *Microstep = jumlah microstep dalam 1 step
00013     *StepPerRev = jumlah step dalam 1 putaran
00014     */
00015     StepperTB(PinName ENA, PinName DIR, PinName PUL, int Microstep, int StepPerRev);
00016     
00017     /*Method*/
00018     /*MoveStep
00019     *Gerakkan stepper sebanyak StepAmt step dengan
00020     *Selang waktu antar microstep selama Interval (dalam us)
00021     */
00022     void MoveOneStep(bool Direction, int Interval);
00023     
00024     /*MoveStep
00025     *Gerakkan stepper sebanyak StepAmt step dengan
00026     *Selang waktu antar microstep selama Interval (dalam us)
00027     */
00028     void MoveStep(int StepAmt, int Interval);
00029     
00030     /*MoveRev
00031     *Gerakkan stepper sejauh RevAmt putaran dengan
00032     *Selang waktu antar microstep selama Interval (dalam us)
00033     */
00034     void MoveRev(int RevAmt, int Interval);
00035     
00036     //Getter
00037     //StepPerRev
00038     int getSPR();
00039     //Microstep
00040     int getMstep();
00041     
00042     private:
00043     //Pins
00044     DigitalOut ENA_;
00045     DigitalOut DIR_;
00046     DigitalOut PUL_;
00047     
00048     int Microstep_;
00049     int StepPerRev_;
00050 
00051 };
00052 
00053 #endif