test0313
sMotor.h@0:4b3b9e047ce3, 2012-06-14 (annotated)
- Committer:
- XtaticO
- Date:
- Thu Jun 14 12:16:40 2012 +0000
- Revision:
- 0:4b3b9e047ce3
- Child:
- 1:0ea5b11066c5
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
XtaticO | 0:4b3b9e047ce3 | 1 | /* |
XtaticO | 0:4b3b9e047ce3 | 2 | ############################################ |
XtaticO | 0:4b3b9e047ce3 | 3 | ## sMotor v0.1 Library ## |
XtaticO | 0:4b3b9e047ce3 | 4 | ## created by Samuel Matildes ## |
XtaticO | 0:4b3b9e047ce3 | 5 | ############################################ |
XtaticO | 0:4b3b9e047ce3 | 6 | ---- sam.naeec@gmail.com ----- |
XtaticO | 0:4b3b9e047ce3 | 7 | This library was made for 4-Phase Stepper Motors |
XtaticO | 0:4b3b9e047ce3 | 8 | I don't take any resposability for the damage caused to your equipment. |
XtaticO | 0:4b3b9e047ce3 | 9 | |
XtaticO | 0:4b3b9e047ce3 | 10 | */ |
XtaticO | 0:4b3b9e047ce3 | 11 | #ifndef MBED_SMOTOR_H |
XtaticO | 0:4b3b9e047ce3 | 12 | #define MBED_SMOTOR_H |
XtaticO | 0:4b3b9e047ce3 | 13 | |
XtaticO | 0:4b3b9e047ce3 | 14 | #include "mbed.h" |
XtaticO | 0:4b3b9e047ce3 | 15 | |
XtaticO | 0:4b3b9e047ce3 | 16 | class sMotor { |
XtaticO | 0:4b3b9e047ce3 | 17 | public: |
XtaticO | 0:4b3b9e047ce3 | 18 | |
XtaticO | 0:4b3b9e047ce3 | 19 | sMotor(PinName A0, PinName A1, PinName A2, PinName A3); //motor constructor |
XtaticO | 0:4b3b9e047ce3 | 20 | |
XtaticO | 0:4b3b9e047ce3 | 21 | void step(int num_steps, int direction, int speed); |
XtaticO | 0:4b3b9e047ce3 | 22 | void anticlockwise(); |
XtaticO | 0:4b3b9e047ce3 | 23 | void clockwise(); |
XtaticO | 0:4b3b9e047ce3 | 24 | |
XtaticO | 0:4b3b9e047ce3 | 25 | |
XtaticO | 0:4b3b9e047ce3 | 26 | private: |
XtaticO | 0:4b3b9e047ce3 | 27 | |
XtaticO | 0:4b3b9e047ce3 | 28 | DigitalOut _A0; |
XtaticO | 0:4b3b9e047ce3 | 29 | DigitalOut _A1; |
XtaticO | 0:4b3b9e047ce3 | 30 | DigitalOut _A2; |
XtaticO | 0:4b3b9e047ce3 | 31 | DigitalOut _A3; |
XtaticO | 0:4b3b9e047ce3 | 32 | |
XtaticO | 0:4b3b9e047ce3 | 33 | }; |
XtaticO | 0:4b3b9e047ce3 | 34 | |
XtaticO | 0:4b3b9e047ce3 | 35 | #endif |