super
Fork of INA219 by
Diff: INA219.cpp
- Revision:
- 1:044908c80119
- Parent:
- 0:eee9c8ba72ff
--- a/INA219.cpp Thu Aug 28 10:32:20 2014 +0000 +++ b/INA219.cpp Sat Mar 25 01:44:05 2017 +0000 @@ -85,4 +85,14 @@ { float raw_current = read_current_raw(); return raw_current / current_divider; +} +int16_t INA219::read_bus_voltage_raw() +{ + return ((int16_t)read_register_u16(INA219_REG_BUSVOLTAGE)>>3)*4; +} + +float INA219::read_bus_voltage() +{ + float raw_voltage = read_bus_voltage_raw(); + return raw_voltage*0.001; } \ No newline at end of file