/ examples / featherwing_ina219_simpletest.py
featherwing_ina219_simpletest.py
 1  """ Example to print out the voltage and current using the INA219 """
 2  import time
 3  from adafruit_featherwing import ina219_featherwing
 4  
 5  INA219 = ina219_featherwing.INA219FeatherWing()
 6  
 7  while True:
 8      print("Bus Voltage:   {} V".format(INA219.bus_voltage))
 9      print("Shunt Voltage: {} V".format(INA219.shunt_voltage))
10      print("Voltage:       {} V".format(INA219.voltage))
11      print("Current:       {} mA".format(INA219.current))
12      print("")
13      time.sleep(0.5)