a easy way to control stepper
Dependents: Ex_stepper Example_for_learning_easy
stepper.h@2:8f2ae2b5c552, 2018-10-16 (annotated)
- Committer:
- Dennis_Yu
- Date:
- Tue Oct 16 07:31:28 2018 +0000
- Revision:
- 2:8f2ae2b5c552
- Parent:
- 1:9a7c41e82ca5
update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Dennis_Yu | 2:8f2ae2b5c552 | 1 | #pragma once |
Dennis_Yu | 0:7caa07ab8d77 | 2 | #include "mbed.h" |
Dennis_Yu | 0:7caa07ab8d77 | 3 | |
Dennis_Yu | 0:7caa07ab8d77 | 4 | #ifndef STEPPER_H |
Dennis_Yu | 0:7caa07ab8d77 | 5 | #define STEPPER_H |
Dennis_Yu | 0:7caa07ab8d77 | 6 | |
Dennis_Yu | 2:8f2ae2b5c552 | 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 | 2:8f2ae2b5c552 | 14 | void rotate(stepper myStepper, double period, int pix); |
Dennis_Yu | 0:7caa07ab8d77 | 15 | |
Dennis_Yu | 2:8f2ae2b5c552 | 16 | void moveTo(stepper xStepper, stepper yStepper, double period, float x, float y); |
Dennis_Yu | 0:7caa07ab8d77 | 17 | |
Dennis_Yu | 0:7caa07ab8d77 | 18 | #endif |