![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
FINAL PROJECT isn't it
Fork of ELEC351 by
STEPPER_MOTOR.hpp@57:aba1296e51b1, 2018-08-15 (annotated)
- Committer:
- thomasmorris
- Date:
- Wed Aug 15 21:34:59 2018 +0000
- Revision:
- 57:aba1296e51b1
- Parent:
- 56:bc5345bc6650
Final Version
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 | 57:aba1296e51b1 | 30 | //Object creations |
thomasmorris | 56:bc5345bc6650 | 31 | |
thomasmorris | 57:aba1296e51b1 | 32 |