Skip to content

Commit e179b04

Browse files
committed
updated example with power
1 parent 359efd7 commit e179b04

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/ina219_simpletest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
bus_voltage = ina219.bus_voltage # voltage on V- (load side)
3333
shunt_voltage = ina219.shunt_voltage # voltage between V+ and V- across the shunt
3434
current = ina219.current # current in mA
35+
power = ina219.power # power in watts
3536

3637
# INA219 measure bus voltage on the load side. So PSU voltage = bus_voltage + shunt_voltage
3738
print("PSU Voltage: {:6.3f} V".format(bus_voltage + shunt_voltage))
3839
print("Shunt Voltage: {:9.6f} V".format(shunt_voltage))
3940
print("Load Voltage: {:6.3f} V".format(bus_voltage))
4041
print("Current: {:9.6f} A".format(current/1000))
42+
print("Power: {:9.6f} W".format(power))
4143
print("")
4244

4345
time.sleep(2)

0 commit comments

Comments
 (0)