From c5d551b582a73d08d2a0ca915f7a1fb8bcc1db89 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 31 May 2021 12:56:53 -0400 Subject: [PATCH] added delay between prints of 0.01 --- python/voltcurrent.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/python/voltcurrent.py b/python/voltcurrent.py index d8b1a492..a509ed6b 100644 --- a/python/voltcurrent.py +++ b/python/voltcurrent.py @@ -178,37 +178,45 @@ if __name__ == "__main__": while (True): try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_one.bus_voltage), "{:6.3f} ".format(ina219_one.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_two.bus_voltage), "{:6.3f} ".format(ina219_two.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_three.bus_voltage), "{:6.3f} ".format(ina219_three.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_four.bus_voltage), "{:6.3f} ".format(ina219_four.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_five.bus_voltage), "{:6.3f} ".format(ina219_five.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_six.bus_voltage), "{:6.3f} ".format(ina219_six.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: + try: + time.sleep(0.01) print("{:6.3f} ".format(ina219_seven.bus_voltage), "{:6.3f} ".format(ina219_seven.current) , end = '') except: print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - try: - print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current) , end = '') + try: + time.sleep(0.01) + print("{:6.3f} ".format(ina219_eight.bus_voltage), "{:6.3f} ".format(ina219_eight.current)) except: - print("{:6.3f} ".format(0), "{:6.3f} ".format(0), end = '') - print(" ") + print("{:6.3f} ".format(0), "{:6.3f} ".format(0)) +# print(" ") inp = input() # print(inp)