a easy way to control stepper
Dependents: Ex_stepper Example_for_learning_easy
Diff: stepper.h
- Revision:
- 2:8f2ae2b5c552
- Parent:
- 1:9a7c41e82ca5
diff -r 9a7c41e82ca5 -r 8f2ae2b5c552 stepper.h --- a/stepper.h Fri Sep 07 14:09:04 2018 +0000 +++ b/stepper.h Tue Oct 16 07:31:28 2018 +0000 @@ -1,19 +1,18 @@ +#pragma once #include "mbed.h" #ifndef STEPPER_H #define STEPPER_H - -struct Stepper +struct stepper { DigitalOut step; DigitalOut dir; DigitalOut en; }; -void rotate(Stepper stepper, double period, int pix); +void rotate(stepper myStepper, double period, int pix); -void moveTo(Stepper xStepper, Stepper yStepper, double period, float x, float y); +void moveTo(stepper xStepper, stepper yStepper, double period, float x, float y); #endif -