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 stepper by
a4988.h@2:e9699816ff84, 2018-06-03 (annotated)
- Committer:
- glintligo
- Date:
- Sun Jun 03 10:17:37 2018 +0000
- Revision:
- 2:e9699816ff84
- Parent:
- 1:88f743f3e7a7
gdfs;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
glintligo | 0:173936452e07 | 1 | #ifndef __A4988_H |
glintligo | 0:173936452e07 | 2 | #define __A4988_H |
glintligo | 0:173936452e07 | 3 | #endif |
glintligo | 0:173936452e07 | 4 | |
glintligo | 0:173936452e07 | 5 | #include "mbed.h" |
glintligo | 0:173936452e07 | 6 | //class Stepper; |
glintligo | 0:173936452e07 | 7 | //typedef void (Stepper::*pClassFun)(); |
glintligo | 0:173936452e07 | 8 | class Stepper |
glintligo | 0:173936452e07 | 9 | { |
glintligo | 0:173936452e07 | 10 | public: |
Bilybill | 1:88f743f3e7a7 | 11 | Stepper(PinName _en = PB_9,PinName _stepPin = PB_0, PinName _direction = PB_7 ); |
Bilybill | 1:88f743f3e7a7 | 12 | void step(int dir, long long int frequency ,volatile long long int _remain); |
glintligo | 0:173936452e07 | 13 | void enable(); |
glintligo | 0:173936452e07 | 14 | void disable(); |
glintligo | 0:173936452e07 | 15 | private: |
glintligo | 0:173936452e07 | 16 | DigitalOut en; |
glintligo | 0:173936452e07 | 17 | DigitalOut stepPin; |
glintligo | 0:173936452e07 | 18 | DigitalOut direction; |
Bilybill | 1:88f743f3e7a7 | 19 | volatile long long int remain; |
glintligo | 0:173936452e07 | 20 | Ticker step_ticker; |
glintligo | 0:173936452e07 | 21 | void step_control(); |
glintligo | 0:173936452e07 | 22 | // pClassFun fun; |
glintligo | 0:173936452e07 | 23 | }; |