
Coiling jig experiment with buttons for coiling, annealing and testing.
Dependencies: TextLCD
STEPPER_MOTOR.hpp@0:7795c79c9480, 2018-12-21 (annotated)
- Committer:
- yphilippou
- Date:
- Fri Dec 21 15:46:23 2018 +0000
- Revision:
- 0:7795c79c9480
Buttons added.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yphilippou | 0:7795c79c9480 | 1 | /* |
yphilippou | 0:7795c79c9480 | 2 | This is the stepper motor class and is used to control all of the motors individually |
yphilippou | 0:7795c79c9480 | 3 | */ |
yphilippou | 0:7795c79c9480 | 4 | |
yphilippou | 0:7795c79c9480 | 5 | #ifndef STEPPER_MOTOR_HPP//Header Guards Prevents Multiple includes |
yphilippou | 0:7795c79c9480 | 6 | #define STEPPER_MOTOR_HPP |
yphilippou | 0:7795c79c9480 | 7 | |
yphilippou | 0:7795c79c9480 | 8 | //Libraries and header includes |
yphilippou | 0:7795c79c9480 | 9 | #include "mbed.h" |
yphilippou | 0:7795c79c9480 | 10 | #include "rtos.h" |
yphilippou | 0:7795c79c9480 | 11 | class STEPPER_MOTOR //This creates a class called Led |
yphilippou | 0:7795c79c9480 | 12 | { |
yphilippou | 0:7795c79c9480 | 13 | public: |
yphilippou | 0:7795c79c9480 | 14 | |
yphilippou | 0:7795c79c9480 | 15 | STEPPER_MOTOR(PinName N1, PinName N2, PinName N3, PinName N4); //Constructor |
yphilippou | 0:7795c79c9480 | 16 | ~STEPPER_MOTOR(); //Destructor |
yphilippou | 0:7795c79c9480 | 17 | void Permanent_Rotate(); |
yphilippou | 0:7795c79c9480 | 18 | void Permanent_Rotate_clock_wise(); |
yphilippou | 0:7795c79c9480 | 19 | void Permanent_Rotate_anti_clock_wise(); |
yphilippou | 0:7795c79c9480 | 20 | void Rotate_90(); |
yphilippou | 0:7795c79c9480 | 21 | void Rotate_Steps(int Steps); |
yphilippou | 0:7795c79c9480 | 22 | private: |
yphilippou | 0:7795c79c9480 | 23 | //Private member variables to prevent them being accessed externally |
yphilippou | 0:7795c79c9480 | 24 | //Data Pins |
yphilippou | 0:7795c79c9480 | 25 | bool _dir; |
yphilippou | 0:7795c79c9480 | 26 | int _step; |
yphilippou | 0:7795c79c9480 | 27 | int _Number_of_steps; |
yphilippou | 0:7795c79c9480 | 28 | DigitalOut pin1; //Pin 1 |
yphilippou | 0:7795c79c9480 | 29 | DigitalOut pin2; //Pin 2 |
yphilippou | 0:7795c79c9480 | 30 | DigitalOut pin3; //Pin 3 |
yphilippou | 0:7795c79c9480 | 31 | DigitalOut pin4; //Pin 4 |
yphilippou | 0:7795c79c9480 | 32 | |
yphilippou | 0:7795c79c9480 | 33 | }; |
yphilippou | 0:7795c79c9480 | 34 | #endif//STEPPER_MOTOR_HPP |