Dependencies: mbed mbed-rtos TextLCD
Interface/Interface.hpp@22:fc2186b610b5, 2019-02-16 (annotated)
- Committer:
- thomasmorris
- Date:
- Sat Feb 16 12:43:26 2019 +0000
- Revision:
- 22:fc2186b610b5
- Parent:
- 21:6d9f6a986647
- Child:
- 23:07a368f2cdb1
Working Code;
Who changed what in which revision?
User | Revision | Line number | New 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 | 21:6d9f6a986647 | 6 | //Led Outputs //check the pin outs. |
thomasmorris | 22:fc2186b610b5 | 7 | //Led Outputs //check the pin outs. |
thomasmorris | 22:fc2186b610b5 | 8 | static DigitalOut Led_Select_Left(D2); |
thomasmorris | 22:fc2186b610b5 | 9 | static DigitalOut Led_Select_Right(D3); |
thomasmorris | 22:fc2186b610b5 | 10 | static DigitalOut Led_Power(A2); |
thomasmorris | 16:9f98ec0ededb | 11 | static STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12); |
thomasmorris | 16:9f98ec0ededb | 12 | |
thomasmorris | 17:68b3fdabe4c5 | 13 | |
thomasmorris | 16:9f98ec0ededb | 14 | class INTERFACE //This creates a class called Led |
thomasmorris | 16:9f98ec0ededb | 15 | { |
thomasmorris | 16:9f98ec0ededb | 16 | public: |
thomasmorris | 16:9f98ec0ededb | 17 | //Public member variables |
thomasmorris | 16:9f98ec0ededb | 18 | |
thomasmorris | 16:9f98ec0ededb | 19 | //Public Member Functions |
thomasmorris | 17:68b3fdabe4c5 | 20 | INTERFACE(int Default_Turns); //Constructor |
thomasmorris | 17:68b3fdabe4c5 | 21 | ~INTERFACE();//Destructor |
thomasmorris | 16:9f98ec0ededb | 22 | |
thomasmorris | 17:68b3fdabe4c5 | 23 | void Interface_Init();//Set all values to 0 |
thomasmorris | 17:68b3fdabe4c5 | 24 | void Up();//Up Routine |
thomasmorris | 17:68b3fdabe4c5 | 25 | void Down();//Down Routine |
thomasmorris | 17:68b3fdabe4c5 | 26 | void Start_Stop();//Start / Stop Routine |
thomasmorris | 17:68b3fdabe4c5 | 27 | void Function();//Function Routine |
thomasmorris | 17:68b3fdabe4c5 | 28 | void Select();//Select Routine |
thomasmorris | 17:68b3fdabe4c5 | 29 | void Interface_main();//Main Routine |
thomasmorris | 16:9f98ec0ededb | 30 | |
thomasmorris | 17:68b3fdabe4c5 | 31 | //Setters to assign data to the private memeber variables |
thomasmorris | 16:9f98ec0ededb | 32 | void Set_No_Of_Rotations(int Rotations); |
thomasmorris | 16:9f98ec0ededb | 33 | void Set_Function(int Function); |
thomasmorris | 16:9f98ec0ededb | 34 | void Set_Twist_Go(bool Twist_Go); |
thomasmorris | 16:9f98ec0ededb | 35 | void Set_Anneal_Go(bool Anneal_Go); |
thomasmorris | 16:9f98ec0ededb | 36 | void Set_Test_Go(bool Test_Go); |
thomasmorris | 16:9f98ec0ededb | 37 | void Set_Select(bool Select); |
thomasmorris | 16:9f98ec0ededb | 38 | void Set_Turns_Done(int Turns_Done); |
thomasmorris | 16:9f98ec0ededb | 39 | void Set_Turns_To_Do(int Turns_To_Do); |
thomasmorris | 16:9f98ec0ededb | 40 | void Set_Loop(int Loop); |
thomasmorris | 16:9f98ec0ededb | 41 | void Set_Wait_Time(int Wait_Time); |
thomasmorris | 16:9f98ec0ededb | 42 | void Set_Duty_Cycle(int Duty_Cycle); |
thomasmorris | 16:9f98ec0ededb | 43 | void Set_Power_Time(float Power_Time); |
thomasmorris | 16:9f98ec0ededb | 44 | |
thomasmorris | 17:68b3fdabe4c5 | 45 | //Getters to receive private information |
thomasmorris | 16:9f98ec0ededb | 46 | int Get_No_Of_Rotations(); |
thomasmorris | 16:9f98ec0ededb | 47 | int Get_Function(); |
thomasmorris | 16:9f98ec0ededb | 48 | bool Get_Twist_Go(); |
thomasmorris | 16:9f98ec0ededb | 49 | bool Get_Anneal_Go(); |
thomasmorris | 16:9f98ec0ededb | 50 | bool Get_Test_Go(); |
thomasmorris | 16:9f98ec0ededb | 51 | bool Get_Select(); |
thomasmorris | 16:9f98ec0ededb | 52 | int Get_Turns_Done(); |
thomasmorris | 16:9f98ec0ededb | 53 | int Get_Turns_To_Do(); |
thomasmorris | 16:9f98ec0ededb | 54 | int Get_Loop(); |
thomasmorris | 16:9f98ec0ededb | 55 | int Get_Wait_Time(); |
thomasmorris | 16:9f98ec0ededb | 56 | int Get_Duty_Cycle(); |
thomasmorris | 16:9f98ec0ededb | 57 | int Get_Power_Time(); |
thomasmorris | 16:9f98ec0ededb | 58 | |
thomasmorris | 16:9f98ec0ededb | 59 | private: |
thomasmorris | 16:9f98ec0ededb | 60 | //Private member variables to prevent them being accessed externally |
thomasmorris | 16:9f98ec0ededb | 61 | |
thomasmorris | 16:9f98ec0ededb | 62 | int _No_Of_Rotations; |
thomasmorris | 16:9f98ec0ededb | 63 | int _Function; |
thomasmorris | 16:9f98ec0ededb | 64 | bool _Twist_Go; |
thomasmorris | 16:9f98ec0ededb | 65 | bool _Anneal_Go; |
thomasmorris | 16:9f98ec0ededb | 66 | bool _Test_Go; |
thomasmorris | 16:9f98ec0ededb | 67 | bool _Select; |
thomasmorris | 16:9f98ec0ededb | 68 | int _Turns_Done; |
thomasmorris | 16:9f98ec0ededb | 69 | int _Turns_Todo; |
thomasmorris | 16:9f98ec0ededb | 70 | int _Loop; |
thomasmorris | 16:9f98ec0ededb | 71 | int _Wait_Time;//IN SECONDS |
thomasmorris | 16:9f98ec0ededb | 72 | int _Duty_Cycle; |
thomasmorris | 16:9f98ec0ededb | 73 | int _Power_Time; |
thomasmorris | 16:9f98ec0ededb | 74 | |
thomasmorris | 16:9f98ec0ededb | 75 | }; |
thomasmorris | 16:9f98ec0ededb | 76 | #endif//INTERFACE_HPP |