Adafruit_CircuitPython_Feat.../examples/featherwing_ina219_simpletest.py
2019-01-17 17:58:39 -05:00

13 lines
465 B
Python
Executable file

""" Example to print out the voltage and current using the INA219 """
import time
from adafruit_featherwing import ina219_featherwing
INA219 = ina219_featherwing.INA219FeatherWing()
while True:
print("Bus Voltage: {} V".format(INA219.bus_voltage))
print("Shunt Voltage: {} V".format(INA219.shunt_voltage))
print("Voltage: {} V".format(INA219.voltage))
print("Current: {} mA".format(INA219.current))
print("")
time.sleep(0.5)