Skip to content

Commit 4525f1c

Browse files
committed
changed voltage units to Volts to match other libs
1 parent 9c50ea6 commit 4525f1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

adafruit_ina260.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ def current(self):
200200

201201
@property
202202
def voltage(self):
203-
"""The bus voltage (between V- and GND) in mV"""
203+
"""The bus voltage in V"""
204204
if self.mode == Mode.TRIGGERED:
205205
while self._conversion_ready == 0:
206206
pass
207-
return self._raw_voltage * 1.25
207+
return self._raw_voltage * 0.00125
208208

209209
@property
210210
def power(self):

examples/ina260_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
i2c = board.I2C()
66
ina260 = adafruit_ina260.INA260(i2c)
77
while True:
8-
print("Current: %.2f Voltage: %.2f Power:%.2f"
8+
print("Current: %.2f mV Voltage: %.2f V Power:%.2f mW"
99
%(ina260.current, ina260.voltage, ina260.power))
1010
time.sleep(1)

0 commit comments

Comments
 (0)