Skip to content

DisplayReadings.ino

Arnd edited this page Jun 19, 2018 · 1 revision

Arduino sketch to demonstrate making current and voltage measurements with any number of supported INAxxx devices.

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 INA library is instantiated and initialized in the setup() method using Parameters for a ±1 Amps maximum current and for a 0.1Ω resistor for all devices detected. Continuous reading mode is set and main loop displays the last measurements computed by all INAxxx devices to the serial port every 5 seconds in an endless loop.