From 74f1ab1ed0a99d48682ae9859e445ced2468cebf Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 25 Oct 2018 07:24:50 -0400 Subject: [PATCH] Update readcurrent.py --- python/readcurrent.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/readcurrent.py b/python/readcurrent.py index b5718520..973d19c3 100644 --- a/python/readcurrent.py +++ b/python/readcurrent.py @@ -1,14 +1,16 @@ SHUNT_OHMS = 0.01 MAX_EXPECTED_AMPS = 2.5 SHUNT_OHMS45 = 0.1 -MAX_EXPECTED_AMPS45 = 0.6 +MAX_EXPECTED_AMPS45 = 0.6 +ina40v = 0 +ina40i = 0 +ina40p = 0 try: from ina219 import INA219 from ina219 import DeviceRangeError INA219DISABLE=1 except: - print "1 INA219 libraries not found or hardware INA219 not found at address 0x4a, defaulting to non-INA219 output" INA219DISABLE=1 if INA219DISABLE !=1: @@ -19,10 +21,6 @@ if INA219DISABLE !=1: ina40v = ina40.voltage() ina40i = ina40.current() ina40p = ina40.power() - except: - ina40v = 0 - ina40i = 0 - ina40p = 0 print ina40v, ina40i, ina40p