Thomas Morris / Mbed OS PROJ324_Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers STEPPER_MOTOR.hpp Source File

STEPPER_MOTOR.hpp

00001 /*
00002 This is the stepper motor class and is used to control all of the motors individually
00003 */
00004 #ifndef STEPPER_MOTOR_HPP//Header Guards Prevents Multiple includes
00005 #define STEPPER_MOTOR_HPP
00006 //Libraries and header includes
00007 #include "THREADS.hpp"
00008 #include "mbed.h"
00009 #include "rtos.h"
00010 #include "SERIAL.hpp"
00011 class STEPPER_MOTOR                       //This creates a class called Led
00012 { 
00013 public: 
00014     STEPPER_MOTOR(PinName STEP, PinName DIRECTION); //Constructor
00015     ~STEPPER_MOTOR();                                 //Destructor
00016     void Permanent_Rotate();
00017     void Permanent_Rotate_clock_wise();
00018     void Permanent_Rotate_anti_clock_wise();
00019     void Rotate_90();
00020     void Rotate_Steps(int Steps, int Direction);
00021 private:    
00022     //Private member variables to prevent them being accessed externally 
00023     //Data Pins
00024     int _Number_of_steps;
00025     DigitalOut _STEP;       //Step
00026     DigitalOut _DIRECTION;  //Direction
00027 };
00028 #endif//STEPPER_MOTOR_HPP
00029 
00030 //Object creations
00031 
00032