Stepper motor for grove
steppermotor.h@0:714a74d01dc3, 2019-01-18 (annotated)
- Committer:
- math991e
- Date:
- Fri Jan 18 07:22:59 2019 +0000
- Revision:
- 0:714a74d01dc3
- Child:
- 2:7b7c58bb9831
Init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
math991e | 0:714a74d01dc3 | 1 | /** |
math991e | 0:714a74d01dc3 | 2 | *#include "steppermotor.h" |
math991e | 0:714a74d01dc3 | 3 | *steppermotor gate(2200, 200); |
math991e | 0:714a74d01dc3 | 4 | * |
math991e | 0:714a74d01dc3 | 5 | * |
math991e | 0:714a74d01dc3 | 6 | *int main() { |
math991e | 0:714a74d01dc3 | 7 | * gate.open(); |
math991e | 0:714a74d01dc3 | 8 | * gate.close(); |
math991e | 0:714a74d01dc3 | 9 | *} |
math991e | 0:714a74d01dc3 | 10 | **/ |
math991e | 0:714a74d01dc3 | 11 | |
math991e | 0:714a74d01dc3 | 12 | |
math991e | 0:714a74d01dc3 | 13 | #ifndef STEPPERMOTOR |
math991e | 0:714a74d01dc3 | 14 | #define STEPPERMOTOR |
math991e | 0:714a74d01dc3 | 15 | |
math991e | 0:714a74d01dc3 | 16 | |
math991e | 0:714a74d01dc3 | 17 | class steppermotor{ |
math991e | 0:714a74d01dc3 | 18 | private: |
math991e | 0:714a74d01dc3 | 19 | int step_speed; |
math991e | 0:714a74d01dc3 | 20 | int numstep; |
math991e | 0:714a74d01dc3 | 21 | public: |
math991e | 0:714a74d01dc3 | 22 | steppermotor(int stepSpeed, int numStep); |
math991e | 0:714a74d01dc3 | 23 | void setStepSpeed(int stepSpeed); |
math991e | 0:714a74d01dc3 | 24 | int getStepSpeed(); |
math991e | 0:714a74d01dc3 | 25 | void setNumStep(int numStep); |
math991e | 0:714a74d01dc3 | 26 | int getNumStep(); |
math991e | 0:714a74d01dc3 | 27 | void open(); |
math991e | 0:714a74d01dc3 | 28 | void close(); |
math991e | 0:714a74d01dc3 | 29 | }; |
math991e | 0:714a74d01dc3 | 30 | |
math991e | 0:714a74d01dc3 | 31 | #endif |