beta1

Dependents:   Ex_Stepper

Fork of a4998 by Keegan Hu

a4988.h

Committer:
glintligo
Date:
2018-07-16
Revision:
2:57c57267b1da
Parent:
1:209911ee18cd
Child:
3:9e9f3cd7fff0

File content as of revision 2:57c57267b1da:

#ifndef __A4988_H
#define __A4988_H
#endif

#include "mbed.h"
class Stepper
{
public:
    Stepper(PinName _en,PinName _stepPin, PinName _direction);
    void step(int dir, int frequency ,volatile int _remain);
    void longrun(int dir,int frequency);
    void stoprun();
    void enable();
    void disable();
private:
    DigitalOut en;
    DigitalOut stepPin;
    DigitalOut direction;
    volatile int remain;
    Ticker step_ticker;
    void step_control();
    void run_control();
};