Testing 1 blue pill

Dependencies:   mbed mbed-rtos TextLCD

Committer:
thomasmorris
Date:
Tue Feb 12 10:03:05 2019 +0000
Revision:
17:68b3fdabe4c5
Parent:
16:9f98ec0ededb
Child:
21:6d9f6a986647
Working Code;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thomasmorris 16:9f98ec0ededb 1 #ifndef INTERFACE_HPP//Header Guards Prevents Multiple includes
thomasmorris 16:9f98ec0ededb 2 #define INTERFACE_HPP
thomasmorris 16:9f98ec0ededb 3
thomasmorris 16:9f98ec0ededb 4 #include "mbed.h"
thomasmorris 17:68b3fdabe4c5 5 #include "STEPPER_MOTOR.hpp" //Include this to use the stepper motor
thomasmorris 16:9f98ec0ededb 6
thomasmorris 16:9f98ec0ededb 7 static STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12);
thomasmorris 16:9f98ec0ededb 8
thomasmorris 17:68b3fdabe4c5 9
thomasmorris 16:9f98ec0ededb 10 class INTERFACE //This creates a class called Led
thomasmorris 16:9f98ec0ededb 11 {
thomasmorris 16:9f98ec0ededb 12 public:
thomasmorris 16:9f98ec0ededb 13 //Public member variables
thomasmorris 16:9f98ec0ededb 14
thomasmorris 16:9f98ec0ededb 15 //Public Member Functions
thomasmorris 17:68b3fdabe4c5 16 INTERFACE(int Default_Turns); //Constructor
thomasmorris 17:68b3fdabe4c5 17 ~INTERFACE();//Destructor
thomasmorris 16:9f98ec0ededb 18
thomasmorris 17:68b3fdabe4c5 19 void Interface_Init();//Set all values to 0
thomasmorris 17:68b3fdabe4c5 20 void Up();//Up Routine
thomasmorris 17:68b3fdabe4c5 21 void Down();//Down Routine
thomasmorris 17:68b3fdabe4c5 22 void Start_Stop();//Start / Stop Routine
thomasmorris 17:68b3fdabe4c5 23 void Function();//Function Routine
thomasmorris 17:68b3fdabe4c5 24 void Select();//Select Routine
thomasmorris 17:68b3fdabe4c5 25 void Interface_main();//Main Routine
thomasmorris 16:9f98ec0ededb 26
thomasmorris 17:68b3fdabe4c5 27 //Setters to assign data to the private memeber variables
thomasmorris 16:9f98ec0ededb 28 void Set_No_Of_Rotations(int Rotations);
thomasmorris 16:9f98ec0ededb 29 void Set_Function(int Function);
thomasmorris 16:9f98ec0ededb 30 void Set_Twist_Go(bool Twist_Go);
thomasmorris 16:9f98ec0ededb 31 void Set_Anneal_Go(bool Anneal_Go);
thomasmorris 16:9f98ec0ededb 32 void Set_Test_Go(bool Test_Go);
thomasmorris 16:9f98ec0ededb 33 void Set_Select(bool Select);
thomasmorris 16:9f98ec0ededb 34 void Set_Turns_Done(int Turns_Done);
thomasmorris 16:9f98ec0ededb 35 void Set_Turns_To_Do(int Turns_To_Do);
thomasmorris 16:9f98ec0ededb 36 void Set_Loop(int Loop);
thomasmorris 16:9f98ec0ededb 37 void Set_Wait_Time(int Wait_Time);
thomasmorris 16:9f98ec0ededb 38 void Set_Duty_Cycle(int Duty_Cycle);
thomasmorris 16:9f98ec0ededb 39 void Set_Power_Time(float Power_Time);
thomasmorris 16:9f98ec0ededb 40
thomasmorris 17:68b3fdabe4c5 41 //Getters to receive private information
thomasmorris 16:9f98ec0ededb 42 int Get_No_Of_Rotations();
thomasmorris 16:9f98ec0ededb 43 int Get_Function();
thomasmorris 16:9f98ec0ededb 44 bool Get_Twist_Go();
thomasmorris 16:9f98ec0ededb 45 bool Get_Anneal_Go();
thomasmorris 16:9f98ec0ededb 46 bool Get_Test_Go();
thomasmorris 16:9f98ec0ededb 47 bool Get_Select();
thomasmorris 16:9f98ec0ededb 48 int Get_Turns_Done();
thomasmorris 16:9f98ec0ededb 49 int Get_Turns_To_Do();
thomasmorris 16:9f98ec0ededb 50 int Get_Loop();
thomasmorris 16:9f98ec0ededb 51 int Get_Wait_Time();
thomasmorris 16:9f98ec0ededb 52 int Get_Duty_Cycle();
thomasmorris 16:9f98ec0ededb 53 int Get_Power_Time();
thomasmorris 16:9f98ec0ededb 54
thomasmorris 16:9f98ec0ededb 55 private:
thomasmorris 16:9f98ec0ededb 56 //Private member variables to prevent them being accessed externally
thomasmorris 16:9f98ec0ededb 57
thomasmorris 16:9f98ec0ededb 58 int _No_Of_Rotations;
thomasmorris 16:9f98ec0ededb 59 int _Function;
thomasmorris 16:9f98ec0ededb 60 bool _Twist_Go;
thomasmorris 16:9f98ec0ededb 61 bool _Anneal_Go;
thomasmorris 16:9f98ec0ededb 62 bool _Test_Go;
thomasmorris 16:9f98ec0ededb 63 bool _Select;
thomasmorris 16:9f98ec0ededb 64 int _Turns_Done;
thomasmorris 16:9f98ec0ededb 65 int _Turns_Todo;
thomasmorris 16:9f98ec0ededb 66 int _Loop;
thomasmorris 16:9f98ec0ededb 67 int _Wait_Time;//IN SECONDS
thomasmorris 16:9f98ec0ededb 68 int _Duty_Cycle;
thomasmorris 16:9f98ec0ededb 69 int _Power_Time;
thomasmorris 16:9f98ec0ededb 70
thomasmorris 16:9f98ec0ededb 71 };
thomasmorris 16:9f98ec0ededb 72 #endif//INTERFACE_HPP