For coursework of group 3 in SOFT564Z
Dependencies: Motordriver ros_lib_kinetic
Diff: Battery_Monitor.hpp
- Revision:
- 11:0b9098ec11c7
- Parent:
- 4:8afc50a3e4ac
- Child:
- 12:82b8fe254222
--- a/Battery_Monitor.hpp Tue Dec 17 16:33:46 2019 +0000 +++ b/Battery_Monitor.hpp Thu Dec 19 00:13:38 2019 +0000 @@ -1,6 +1,7 @@ #include "mbed.h" #include "General.hpp" #include "Pins.h" +#include "rtos.h" #define Minimum_VBatt 3.6f #define Maximum_VBatt 5.0f @@ -12,14 +13,16 @@ class Battery_Monitor { public: - Battery_Monitor(PinName Batt_PIN, int sample_Freq, PinName RED_Channel, PinName GREEN_Channel, PinName BLUE_Channel): V_Batt(Batt_PIN), Sample_Freq(sample_Freq), Channel_1(RED_Channel), Channel_2(GREEN_Channel), Channel_3(BLUE_Channel) + Battery_Monitor(PinName Batt_PIN, int sample_Freq): V_Batt(Batt_PIN), Sample_Freq(sample_Freq) //(PinName Batt_PIN, int sample_Freq, PinName RED_Channel, PinName GREEN_Channel, PinName BLUE_Channel): V_Batt(Batt_PIN), Sample_Freq(sample_Freq), Channel_1(RED_Channel), Channel_2(GREEN_Channel), Channel_3(BLUE_Channel) { + /* this->Channel_1.write(0.0f); this->Channel_1.period(1.0f/PWM_Freq); this->Channel_2.write(0.0f); this->Channel_2.period(1.0f/PWM_Freq); this->Channel_3.write(0.0f); this->Channel_3.period(1.0f/PWM_Freq); + */ this->BattCheck.attach(this, &Battery_Monitor::battCheck, 1/Sample_Freq); }; @@ -38,9 +41,11 @@ Ticker BattCheck; AnalogIn V_Batt; + /* PwmOut Channel_1; PwmOut Channel_2; PwmOut Channel_3; + */ }; #endif