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
stepper.h@1:bbb51c42e7d2, 2018-07-25 (annotated)
- Committer:
- Dennis_Yu
- Date:
- Wed Jul 25 07:51:33 2018 +0000
- Revision:
- 1:bbb51c42e7d2
- Parent:
- 0:0774a793a83b
- Child:
- 2:e537d08c705b
add funcs
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Dennis_Yu | 0:0774a793a83b | 1 | #include <mbed.h> |
| Dennis_Yu | 0:0774a793a83b | 2 | |
| Dennis_Yu | 0:0774a793a83b | 3 | #ifndef STEPPER_H |
| Dennis_Yu | 0:0774a793a83b | 4 | #define STEPPER_H |
| Dennis_Yu | 0:0774a793a83b | 5 | |
| Dennis_Yu | 0:0774a793a83b | 6 | class stepperMotor |
| Dennis_Yu | 0:0774a793a83b | 7 | { |
| Dennis_Yu | 0:0774a793a83b | 8 | public: |
| Dennis_Yu | 1:bbb51c42e7d2 | 9 | int remain; |
| Dennis_Yu | 1:bbb51c42e7d2 | 10 | stepperMotor(){;} |
| Dennis_Yu | 1:bbb51c42e7d2 | 11 | stepperMotor(PinName stepPin, PinName dirPin, PinName enPin); |
| Dennis_Yu | 1:bbb51c42e7d2 | 12 | // step(stepPin),dir(dirPin),en(enPin), remain(0){;} |
| Dennis_Yu | 1:bbb51c42e7d2 | 13 | void init(); |
| Dennis_Yu | 1:bbb51c42e7d2 | 14 | Ticker stepper; |
| Dennis_Yu | 1:bbb51c42e7d2 | 15 | private: |
| Dennis_Yu | 0:0774a793a83b | 16 | DigitalOut step; |
| Dennis_Yu | 0:0774a793a83b | 17 | DigitalOut dir; |
| Dennis_Yu | 0:0774a793a83b | 18 | DigitalOut en; |
| Dennis_Yu | 1:bbb51c42e7d2 | 19 | void moveStepper(); |
| Dennis_Yu | 0:0774a793a83b | 20 | }; |
| Dennis_Yu | 0:0774a793a83b | 21 | |
| Dennis_Yu | 0:0774a793a83b | 22 | #endif |
