Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

DisplayReadings.ino

Arnd edited this page Jun 22, 2018 · 2 revisions

‼️ This library is now deprecated and has been replaced by the INA library. All existing INA226 functionality and functions have been implemented ‼️

Arduino sketch to demonstrate making current and voltage measurements with the INA226 chip.

Compatibility

The code contains no processor specific conditional code apart from the interrupt mechanism described below and therefore should work on all Atmel Arduinos. It was designed and tested on both Arduino Micro and Arduino Mega boards.

Function

The INA226 is initialized in the setup() method for a ±1 Amps maximum current and for a 0.1Ω resistor. Continuous reading mode is set and main loop displays the last measurements computed by the INA226 to the serial port every 5 seconds in an endless loop.