From 8d84f128283e9a253537aabc53d4b7fce8f79ec4 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Thu, 25 Oct 2018 07:12:08 -0400 Subject: [PATCH] Update readcurrent.py --- python/readcurrent.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/readcurrent.py b/python/readcurrent.py index abde5ec6..c8a1eadf 100644 --- a/python/readcurrent.py +++ b/python/readcurrent.py @@ -24,6 +24,17 @@ try: except: print "1 INA219 libraries not found or hardware INA219 not found at address 0x4a, defaulting to non-INA219 output" INA219DISABLE=1 + +try: + ina40v = ina40.voltage() + ina40i = ina40.current() + ina40p = ina40.power() +except: + ina40v = 0 + ina40i = 0 + ina40p = 0 + +print ina40v, ina40i, ina40p if INA219DISABLE !=1: ina4A = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, 0x4a)