![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Skeleton code. LCD, Serial, Feedback, MOSFETS
Dependencies: mbed mbed-rtos ShiftReg2 TextLCD
Diff: FEEDBACK/Feedback.cpp
- Revision:
- 4:020f93d35f6e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FEEDBACK/Feedback.cpp Tue May 07 21:55:57 2019 +0000 @@ -0,0 +1,64 @@ +#include "Feedback.hpp" +//Constructor +FEEDBACK::FEEDBACK(PinName N1, PinName N2, PinName N3, PinName N4, PinName N5, PinName N6, PinName N7, PinName N8, PinName N9, PinName N10) : +_Battery_Measurement(N1),_Temperature_Sensor_1(N2),_Temperature_Sensor_2(N3),_Temperature_Sensor_3(N4), +_Feedback_Sensor_1(N5),_Feedback_Sensor_2(N6),_Feedback_Sensor_3(N7),_Feedback_Sensor_4(N8),_Feedback_Sensor_5(N9),_Feedback_Sensor_6(N10) +{ + _Battery_Measurement_Value_Mutex.lock(); + _Battery_Measurement_Value = 0; + _Battery_Measurement_Value_Mutex.unlock(); + _Temp_1_Value_Mutex.lock(); + _Temp_1_Value = 0; + _Temp_1_Value_Mutex.unlock(); + _Temp_2_Value_Mutex.lock(); + _Temp_2_Value = 0; + _Temp_2_Value_Mutex.unlock(); + _Temp_3_Value_Mutex.lock(); + _Temp_3_Value = 0; + _Temp_3_Value_Mutex.unlock(); + _Feedback_1_Value_Mutex.lock(); + _Feedback_1_Value = 0; + _Feedback_1_Value_Mutex.unlock(); + _Feedback_2_Value_Mutex.lock(); + _Feedback_2_Value = 0; + _Feedback_2_Value_Mutex.unlock(); + _Feedback_3_Value_Mutex.lock(); + _Feedback_3_Value = 0; + _Feedback_3_Value_Mutex.unlock(); + _Feedback_4_Value_Mutex.lock(); + _Feedback_4_Value = 0; + _Feedback_4_Value_Mutex.unlock(); + _Feedback_5_Value_Mutex.unlock(); + _Feedback_5_Value = 0; + _Feedback_5_Value_Mutex.lock(); + _Feedback_6_Value_Mutex.unlock(); + _Feedback_6_Value = 0; + _Feedback_6_Value_Mutex.unlock(); +} +FEEDBACK::~FEEDBACK(){}//Destructor +void FEEDBACK::Init(){}//Initialisation Routine +int FEEDBACK::Post()//Power on self test +{ + return 1;//Success +} + +float FEEDBACK::Get_Battery_Measurement_Value(){_Battery_Measurement_Value_Mutex.lock(); +_Battery_Measurement_Value = _Battery_Measurement.read();_Battery_Measurement_Value_Mutex.unlock();return _Battery_Measurement_Value;} +float FEEDBACK::Get_Temp_1_Value(){_Temp_1_Value_Mutex.lock(); +_Temp_1_Value = _Temperature_Sensor_1.read();_Temp_1_Value_Mutex.unlock(); return _Temp_1_Value;} +float FEEDBACK::Get_Temp_2_Value(){_Temp_2_Value_Mutex.lock(); +_Temp_2_Value = _Temperature_Sensor_2.read();_Temp_2_Value_Mutex.unlock(); return _Temp_2_Value;} +float FEEDBACK::Get_Temp_3_Value(){_Temp_3_Value_Mutex.lock(); +_Temp_3_Value = _Temperature_Sensor_3.read();_Temp_3_Value_Mutex.unlock(); return _Temp_3_Value;} +float FEEDBACK::Get_Feedback_1_Value(){_Feedback_1_Value_Mutex.lock(); +_Feedback_1_Value = _Feedback_Sensor_1.read(); _Feedback_1_Value_Mutex.unlock();return _Feedback_1_Value;} +float FEEDBACK::Get_Feedback_2_Value(){_Feedback_2_Value_Mutex.lock(); +_Feedback_2_Value = _Feedback_Sensor_2.read(); _Feedback_2_Value_Mutex.unlock();return _Feedback_2_Value;} +float FEEDBACK::Get_Feedback_3_Value(){_Feedback_3_Value_Mutex.lock(); +_Feedback_3_Value = _Feedback_Sensor_3.read(); _Feedback_3_Value_Mutex.unlock();return _Feedback_3_Value;} +float FEEDBACK::Get_Feedback_4_Value(){_Feedback_4_Value_Mutex.lock(); +_Feedback_4_Value = _Feedback_Sensor_4.read(); _Feedback_4_Value_Mutex.unlock();return _Feedback_4_Value;} +float FEEDBACK::Get_Feedback_5_Value(){_Feedback_5_Value_Mutex.lock(); +_Feedback_5_Value = _Feedback_Sensor_5.read(); _Feedback_5_Value_Mutex.unlock();return _Feedback_5_Value;} +float FEEDBACK::Get_Feedback_6_Value(){_Feedback_6_Value_Mutex.lock(); +_Feedback_6_Value = _Feedback_Sensor_6.read(); _Feedback_6_Value_Mutex.unlock();return _Feedback_6_Value;}