adafruit / Adafruit_CircuitPython_INA219

circuit python driver for INA219 current sensor
MIT License
26 stars 26 forks source link

Improve example outputs #26

Closed WizardTim closed 3 years ago

WizardTim commented 3 years ago

Old

PSU Voltage:    3.292 V
Shunt Voltage:  0.003520 V
Load Voltage:   3.288 V
Current:        0.035200 A

New

Voltage (VIN+) :  3.292   V
Voltage (VIN-) :  3.288   V
Shunt Voltage  :  0.00352 V
Shunt Current  :  0.0352  A
Power Calc.    :  0.11574 W
Power Register :  0.115   W

With gain = DIV_1_40MV and _cal_value = 65535 to force a math overflow in current register. New

Voltage (VIN+) :  3.128   V
Voltage (VIN-) :  3.088   V
Shunt Voltage  :  0.04000 V
Shunt Current  :  3.2767  A
Power Calc.    : 10.11845 W
Power Register : 10.118   W

Internal Math Overflow Detected!