Arduino Code

Programming the Adafruit INA219 breakout board is simple using our library:

Install the Library

  • Expand the .zip file to the Libraries folder in your Arduino Sketchbook folder (If you don't know where this is, open File->Preferences in the IDE and it will tell you the location of your sketchbook folder).
  • Rename the folder to Adafruit_INA219
  • Close all instances of the IDE, then re-open one, so that the IDE will recognize the new library.

Load the Example

  • Select "File->Examples->Adafruit_INA219->getcurrent"
  • The "getcurrent" example code should open in a new IDE window.

Run it!

  • Click on the upload button in the IDE.  When it is "done uploading"
  • Open your Serial Monitor and set the speed to 115200 baud.
The output should appear similar to the sample below:

Customize it

You can adapt, expand or modify the example code to suit your project requirements.  For a detailed description of the available library functions, see the Library Reference on the next page:
Last updated on Nov 17, 2017 Published on Oct 26, 2012