Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of a4998 by
a4988.h
- Committer:
- brainliang
- Date:
- 2018-05-08
- Revision:
- 1:ab0f997c2d9c
- Parent:
- 0:173936452e07
File content as of revision 1:ab0f997c2d9c:
#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); //方向,频率,步数3个参数
void enable();
void disable();
private:
DigitalOut en;
DigitalOut stepPin;
DigitalOut direction;
volatile int remain;
Ticker step_ticker;
void step_control();
// pClassFun fun;
};
