a easy way to control stepper
Dependents: Ex_stepper Example_for_learning_easy
stepper.h@1:9a7c41e82ca5, 2018-09-07 (annotated)
- Committer:
- Dennis_Yu
- Date:
- Fri Sep 07 14:09:04 2018 +0000
- Revision:
- 1:9a7c41e82ca5
- Parent:
- 0:7caa07ab8d77
- Child:
- 2:8f2ae2b5c552
bug fixed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Dennis_Yu | 0:7caa07ab8d77 | 1 | #include "mbed.h" |
Dennis_Yu | 0:7caa07ab8d77 | 2 | |
Dennis_Yu | 0:7caa07ab8d77 | 3 | #ifndef STEPPER_H |
Dennis_Yu | 0:7caa07ab8d77 | 4 | #define STEPPER_H |
Dennis_Yu | 0:7caa07ab8d77 | 5 | |
Dennis_Yu | 0:7caa07ab8d77 | 6 | |
Dennis_Yu | 0:7caa07ab8d77 | 7 | struct Stepper |
Dennis_Yu | 0:7caa07ab8d77 | 8 | { |
Dennis_Yu | 1:9a7c41e82ca5 | 9 | DigitalOut step; |
Dennis_Yu | 1:9a7c41e82ca5 | 10 | DigitalOut dir; |
Dennis_Yu | 1:9a7c41e82ca5 | 11 | DigitalOut en; |
Dennis_Yu | 0:7caa07ab8d77 | 12 | }; |
Dennis_Yu | 0:7caa07ab8d77 | 13 | |
Dennis_Yu | 0:7caa07ab8d77 | 14 | void rotate(Stepper stepper, double period, int pix); |
Dennis_Yu | 0:7caa07ab8d77 | 15 | |
Dennis_Yu | 0:7caa07ab8d77 | 16 | void moveTo(Stepper xStepper, Stepper yStepper, double period, float x, float y); |
Dennis_Yu | 0:7caa07ab8d77 | 17 | |
Dennis_Yu | 0:7caa07ab8d77 | 18 | #endif |
Dennis_Yu | 0:7caa07ab8d77 | 19 |