baseline build
Dependencies: FastPWM mbed-os mbed
Diff: ADCInput.h
- Revision:
- 0:8a420ac6394e
diff -r 000000000000 -r 8a420ac6394e ADCInput.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ADCInput.h Mon Jun 19 15:55:51 2017 +0000 @@ -0,0 +1,29 @@ +#ifndef __ADC_INPUT_H__ +#define __ADC_INPUT_H__ + +#include "mbed.h" + +const uint16_t NUM_SAMPLES = 30; + +class ADCInput +{ +public: + ADCInput(void); + + double GetSensedVoltage(void); + double GetSensedCurrent(void); + double GetRMSVoltage(void); + double GetRMSCurrent(void); + double GetSensedPower(void); + double GetResistance(void); + +private: + double avgValue; + AnalogIn vSense; + AnalogIn iSense; + AnalogIn vRMS; + AnalogIn iRMS; +}; + + +#endif