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
 5
 6import board
 7
 8import adafruit_ina260
 9
10i2c = board.I2C()  # uses board.SCL and board.SDA
11# i2c = board.STEMMA_I2C()  # For using the built-in STEMMA QT connector on a microcontroller
12ina260 = adafruit_ina260.INA260(i2c)
13while True:
14    print(
15        f"Current: {ina260.current:.2f} mA Voltage: {ina260.voltage:.2f} V Power:{ina260.power:.2f} mW"  # noqa: E501
16    )
17    time.sleep(1)