Keegan Hu / a4998ss

Fork of stepper by Biy Bill

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers a4988.h Source File

a4988.h

00001 #ifndef __A4988_H
00002 #define __A4988_H
00003 #endif
00004 
00005 #include "mbed.h"
00006 //class Stepper;
00007 //typedef void (Stepper::*pClassFun)();
00008 class Stepper
00009 {
00010 public:
00011     Stepper(PinName _en = PB_9,PinName _stepPin = PB_0, PinName _direction = PB_7 );
00012     void step(int dir, long long int frequency ,volatile long long int _remain);
00013     void enable();
00014     void disable();
00015 private:
00016     DigitalOut en;
00017     DigitalOut stepPin;
00018     DigitalOut direction;
00019     volatile long long int remain;
00020     Ticker step_ticker;
00021     void step_control();
00022    // pClassFun fun;
00023 };