Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos TextLCD
Interface/Interface.hpp
- Committer:
- thomasmorris
- Date:
- 2019-02-16
- Revision:
- 23:07a368f2cdb1
- Parent:
- 22:fc2186b610b5
- Child:
- 25:9751619fa030
File content as of revision 23:07a368f2cdb1:
#ifndef INTERFACE_HPP//Header Guards Prevents Multiple includes
#define INTERFACE_HPP
#include "mbed.h"
#include "STEPPER_MOTOR.hpp" //Include this to use the stepper motor
//Led Outputs //check the pin outs
static DigitalOut Led_Select_Left(D2);
static DigitalOut Led_Select_Right(D3);
static DigitalOut Led_Power(A2);
static STEPPER_MOTOR STEPPER_MOTOR_1(D15,D14,D13,D12);
static PwmOut Tendon_Power(PE_8);
class INTERFACE//This creates a class called Led
{
public:
//Public member variables
//Public Member Functions
INTERFACE(int Default_Turns); //Constructor
~INTERFACE();//Destructor
void Interface_Init();//Set all values to 0
void Up();//Up Routine
void Down();//Down Routine
void Start_Stop();//Start / Stop Routine
void Function();//Function Routine
void Select();//Select Routine
void Interface_main();//Main Routine
//Setters to assign data to the private memeber variables
void Set_System_Running(int System_Running);
void Set_Function(int Function);
void Set_Twist_Go(bool Twist_Go);
void Set_Anneal_Go(bool Anneal_Go);
void Set_Test_Go(bool Test_Go);
void Set_Twist_Stop(bool Twist_Stop);
void Set_Anneal_Stop(bool Anneal_Stop);
void Set_Test_Stop(bool Test_Stop);
void Set_Select(bool Select);
void Set_Turns_Done(int Turns_Done);
void Set_Turns_To_Do(int Turns_To_Do);
void Set_Loop(int Loop);
void Set_Wait_Time(int Wait_Time);
void Set_Duty_Cycle(int Duty_Cycle);
void Set_Power_Time(float Power_Time);
//Getters to receive private information
int Get_System_Running();
int Get_Function();
bool Get_Twist_Go();
bool Get_Anneal_Go();
bool Get_Test_Go();
bool Get_Twist_Stop();
bool Get_Anneal_Stop();
bool Get_Test_Stop();
bool Get_Select();
int Get_Turns_Done();
int Get_Turns_To_Do();
int Get_Loop();
int Get_Wait_Time();
int Get_Duty_Cycle();
int Get_Power_Time();
private:
//Private member variables to prevent them being accessed externally
int _System_Running;
int _No_Of_Rotations;
int _Function;
//Start
bool _Twist_Go;
bool _Anneal_Go;
bool _Test_Go;
//Stop
bool _Twist_Stop;
bool _Anneal_Stop;
bool _Test_Stop;
bool _Select;
int _Turns_Done;
int _Turns_Todo;
int _Loop;
int _Wait_Time;//IN SECONDS
int _Duty_Cycle;
int _Power_Time;
//Mutex Locks
Mutex _System_Running_mutex;
Mutex _No_Of_Rotations_mutex;
Mutex _Function_mutex;
Mutex _Twist_Go_mutex;
Mutex _Anneal_Go_mutex;
Mutex _Test_Go_mutex;
Mutex _Twist_Stop_mutex;
Mutex _Anneal_Stop_mutex;
Mutex _Test_Stop_mutex;
Mutex _Select_mutex;
Mutex _Turns_Done_mutex;
Mutex _Turns_Todo_mutex;
Mutex _Loop_mutex;
Mutex _Wait_Time_mutex;//IN SECONDS
Mutex _Duty_Cycle_mutex;
Mutex _Power_Time_mutex;
Mutex _Tendon_mutex;
Mutex Led_Select_Left_mutex;
Mutex Led_Select_Right_mutex;
Mutex Led_Power_mutex;
};
#endif//INTERFACE_HPP