Skip to content

Commit d1e68be

Browse files
authored
Restored Original Test
1 parent f43322d commit d1e68be

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/ina219_simpletest.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
i2c_bus = board.I2C()
99

10-
ina219 = INA219(i2c_bus, 0x41)
11-
ina219.set_calibration_16V_5A()
10+
ina219 = INA219(i2c_bus)
1211

1312
print("ina219 test")
1413

@@ -22,24 +21,22 @@
2221
print("")
2322

2423
# optional : change configuration to use 32 samples averaging for both bus voltage and shunt voltage
25-
#ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S
26-
#ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S
24+
ina219.bus_adc_resolution = ADCResolution.ADCRES_12BIT_32S
25+
ina219.shunt_adc_resolution = ADCResolution.ADCRES_12BIT_32S
2726
# optional : change voltage range to 16V
28-
#ina219.bus_voltage_range = BusVoltageRange.RANGE_16V
27+
ina219.bus_voltage_range = BusVoltageRange.RANGE_16V
2928

3029
# measure and display loop
3130
while True:
3231
bus_voltage = ina219.bus_voltage # voltage on V- (load side)
3332
shunt_voltage = ina219.shunt_voltage # voltage between V+ and V- across the shunt
3433
current = ina219.current # current in mA
35-
power = ina219.power # power in watts
3634

3735
# INA219 measure bus voltage on the load side. So PSU voltage = bus_voltage + shunt_voltage
3836
print("PSU Voltage: {:6.3f} V".format(bus_voltage + shunt_voltage))
3937
print("Shunt Voltage: {:9.6f} V".format(shunt_voltage))
4038
print("Load Voltage: {:6.3f} V".format(bus_voltage))
4139
print("Current: {:9.6f} A".format(current/1000))
42-
print("Power: {:9.6f} mW".format(power*1000))
4340
print("")
4441

4542
time.sleep(2)

0 commit comments

Comments
 (0)