User Manual

First we include the library and create an Adafruit_INA260 object to use in the rest of the sketch.
Next, in the setup we call the INA260 object's begin function to initialize the driver and prepare it to read
measurements from the sensor.
The begin function will return false if it is unable to make a connection to an INA260 sensor. If this happens, double
check your power and I2C wiring.
Finally we can take some readings! readCurrent , readBusVoltage , and readPower all read and return the given
measurements in milliamps, millivolts, and milliwatts respectively.
To get accurate measurements when calling readVoltage and readPower you will need to cut the VB jumper on the
right side of the breakout and connect the VBus pin to your bus.
#include <Adafruit_INA260.h>
Adafruit_INA260 ina260 = Adafruit_INA260();
if (!ina260.begin()) {
Serial.println("Couldn't find INA260 chip");
while (1);
}
Serial.print("Current: ");
Serial.print(ina260.readCurrent());
Serial.println(" mA");
Serial.print("Bus Voltage: ");
Serial.print(ina260.readBusVoltage());
Serial.println(" mV");
Serial.print("Power: ");
Serial.print(ina260.readPower());
Serial.println(" mW");
By default power and voltage measurements are only accurate for high side current sensing
© Adafruit Industries
https://learn.adafruit.com/adafruit-ina260-current-voltage-power-sensor-
breakout
Page 16 of 24