From 60bc426342b494b730ac4701b71708258bb1a8be Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 25 Oct 2018 07:27:21 -0400 Subject: [PATCH] Update readcurrent.py --- python/readcurrent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/readcurrent.py b/python/readcurrent.py index ed4028f1..89351d2c 100644 --- a/python/readcurrent.py +++ b/python/readcurrent.py @@ -5,6 +5,7 @@ MAX_EXPECTED_AMPS45 = 0.6 ina40v = 0 ina40i = 0 ina40p = 0 +FAIL = -1 try: from ina219 import INA219 @@ -21,7 +22,8 @@ if INA219DISABLE !=1: ina40v = ina40.voltage() ina40i = ina40.current() ina40p = ina40.power() - except: + except: + FAIL = 1 print ina40v, ina40i, ina40p if INA219DISABLE !=1: