afsd

Fork of a4998 by Keegan Hu

a4988.h

Committer:
Bilybill
Date:
2018-05-11
Revision:
1:88f743f3e7a7
Parent:
0:173936452e07

File content as of revision 1:88f743f3e7a7:

#ifndef __A4988_H
#define __A4988_H
#endif

#include "mbed.h"
//class Stepper;
//typedef void (Stepper::*pClassFun)();
class Stepper
{
public:
    Stepper(PinName _en = PB_9,PinName _stepPin = PB_0, PinName _direction = PB_7 );
    void step(int dir, long long int frequency ,volatile long long int _remain);
    void enable();
    void disable();
private:
    DigitalOut en;
    DigitalOut stepPin;
    DigitalOut direction;
    volatile long long int remain;
    Ticker step_ticker;
    void step_control();
   // pClassFun fun;
};