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