mit
Diff: CurrentSense.h
- Revision:
- 4:5ae9f8b3a16f
- Child:
- 5:e90c8b57811c
diff -r cae0b305d54c -r 5ae9f8b3a16f CurrentSense.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CurrentSense.h Tue Nov 24 03:56:22 2015 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" + +#ifndef CURRENT_SENSE_H +#define CURRENT_SENSE_H + +// 3.3V max ADC reading / 0.525V/A from the current amp +#define ADC_TO_CURRENT_SCALE (3.3/.525) + +class CurrentSense { + public: + CurrentSense(PinName current_pin); + + float get_current(void); + + private: + AnalogIn current_pin_; +}; + +#endif \ No newline at end of file