Simple test¶
Ensure your device works with this simple test.
examples/ina260_simpletest.py¶
1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2# SPDX-License-Identifier: MIT
3
4import time
5import board
6import adafruit_ina260
7
8i2c = board.I2C()
9ina260 = adafruit_ina260.INA260(i2c)
10while True:
11 print(
12 "Current: %.2f mA Voltage: %.2f V Power:%.2f mW"
13 % (ina260.current, ina260.voltage, ina260.power)
14 )
15 time.sleep(1)