chickenhouse/power_sensor_test.py

15 lines
296 B
Python
Raw Normal View History

2016-03-20 17:49:34 +00:00
#!/usr/bin/python2
from power_sensor import power_sensor
from time import sleep
ps = power_sensor(1, 0x40)
while True:
voltage = ps.shunt_voltage_mv()
print str(voltage) + " mV"
current = ps.current_ma()
print str(current) + " mA"
power = ps.power_mw()
print str(power) + " mW"
sleep(1)