a easy way to control stepper

Dependents:   Ex_stepper Example_for_learning_easy

Committer:
Dennis_Yu
Date:
Fri Sep 07 13:52:14 2018 +0000
Revision:
0:7caa07ab8d77
Child:
1:9a7c41e82ca5
an easier version of stepper

Who changed what in which revision?

UserRevisionLine numberNew 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 0:7caa07ab8d77 9 PinName step;
Dennis_Yu 0:7caa07ab8d77 10 PinName dir;
Dennis_Yu 0:7caa07ab8d77 11 PinName 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