Plymouth ELEC351 Group T
/
ELEC351_Group_T
FINAL PROJECT isn't it
Fork of ELEC351 by
STEPPER_MOTOR.hpp@56:bc5345bc6650, 2018-07-16 (annotated)
- Committer:
- thomasmorris
- Date:
- Mon Jul 16 10:51:47 2018 +0000
- Revision:
- 56:bc5345bc6650
- Parent:
- 53:71f59e195f06
- Child:
- 57:aba1296e51b1
Moves added to serial;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomasmorris | 53:71f59e195f06 | 1 | /* |
thomasmorris | 53:71f59e195f06 | 2 | This is the stepper motor class and is used to control all of the motors individually |
thomasmorris | 53:71f59e195f06 | 3 | */ |
thomasmorris | 53:71f59e195f06 | 4 | #ifndef STEPPER_MOTOR_HPP//Header Guards Prevents Multiple includes |
thomasmorris | 53:71f59e195f06 | 5 | #define STEPPER_MOTOR_HPP |
thomasmorris | 53:71f59e195f06 | 6 | //Libraries and header includes |
thomasmorris | 53:71f59e195f06 | 7 | #include "THREADS.hpp" |
thomasmorris | 53:71f59e195f06 | 8 | #include "mbed.h" |
thomasmorris | 53:71f59e195f06 | 9 | #include "rtos.h" |
thomasmorris | 53:71f59e195f06 | 10 | #include "SERIAL.hpp" |
thomasmorris | 53:71f59e195f06 | 11 | class STEPPER_MOTOR //This creates a class called Led |
thomasmorris | 53:71f59e195f06 | 12 | { |
thomasmorris | 53:71f59e195f06 | 13 | public: |
thomasmorris | 53:71f59e195f06 | 14 | STEPPER_MOTOR(PinName STEP, PinName DIRECTION); //Constructor |
thomasmorris | 53:71f59e195f06 | 15 | ~STEPPER_MOTOR(); //Destructor |
thomasmorris | 53:71f59e195f06 | 16 | void Permanent_Rotate(); |
thomasmorris | 53:71f59e195f06 | 17 | void Permanent_Rotate_clock_wise(); |
thomasmorris | 53:71f59e195f06 | 18 | void Permanent_Rotate_anti_clock_wise(); |
thomasmorris | 53:71f59e195f06 | 19 | void Rotate_90(); |
thomasmorris | 53:71f59e195f06 | 20 | void Rotate_Steps(int Steps, int Direction); |
thomasmorris | 53:71f59e195f06 | 21 | private: |
thomasmorris | 53:71f59e195f06 | 22 | //Private member variables to prevent them being accessed externally |
thomasmorris | 53:71f59e195f06 | 23 | //Data Pins |
thomasmorris | 53:71f59e195f06 | 24 | int _Number_of_steps; |
thomasmorris | 53:71f59e195f06 | 25 | DigitalOut _STEP; //Step |
thomasmorris | 53:71f59e195f06 | 26 | DigitalOut _DIRECTION; //Direction |
thomasmorris | 56:bc5345bc6650 | 27 | }; |
thomasmorris | 56:bc5345bc6650 | 28 | #endif//STEPPER_MOTOR_HPP |
thomasmorris | 53:71f59e195f06 | 29 | |
thomasmorris | 56:bc5345bc6650 | 30 |