Proj 324 Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Revision:
53:71f59e195f06
Child:
56:bc5345bc6650
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/STEPPER_MOTOR.hpp	Mon May 07 15:44:34 2018 +0000
@@ -0,0 +1,32 @@
+/*
+This is the stepper motor class and is used to control all of the motors individually
+*/
+
+#ifndef STEPPER_MOTOR_HPP//Header Guards Prevents Multiple includes
+#define STEPPER_MOTOR_HPP
+
+//Libraries and header includes
+#include "THREADS.hpp"
+#include "mbed.h"
+#include "rtos.h"
+#include "SERIAL.hpp"
+class STEPPER_MOTOR                       //This creates a class called Led
+{ 
+public: 
+ 
+    STEPPER_MOTOR(PinName STEP, PinName DIRECTION); //Constructor
+    ~STEPPER_MOTOR();                                 //Destructor
+    void Permanent_Rotate();
+    void Permanent_Rotate_clock_wise();
+    void Permanent_Rotate_anti_clock_wise();
+    void Rotate_90();
+    void Rotate_Steps(int Steps, int Direction);
+private:    
+    //Private member variables to prevent them being accessed externally 
+    //Data Pins
+    int _Number_of_steps;
+    DigitalOut _STEP;       //Step
+    DigitalOut _DIRECTION;  //Direction
+
+};
+#endif//STEPPER_MOTOR_HPP
\ No newline at end of file