fdsfaf
Diff: a4988.h
- Revision:
- 0:173936452e07
- Child:
- 1:209911ee18cd
diff -r 000000000000 -r 173936452e07 a4988.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a4988.h Wed May 02 10:48:23 2018 +0000 @@ -0,0 +1,23 @@ +#ifndef __A4988_H +#define __A4988_H +#endif + +#include "mbed.h" +//class Stepper; +//typedef void (Stepper::*pClassFun)(); +class Stepper +{ +public: + Stepper(PinName _en,PinName _stepPin, PinName _direction); + void step(int dir, int frequency ,volatile int _remain); + void enable(); + void disable(); +private: + DigitalOut en; + DigitalOut stepPin; + DigitalOut direction; + volatile int remain; + Ticker step_ticker; + void step_control(); + // pClassFun fun; +};