-
Notifications
You must be signed in to change notification settings - Fork 41
DisplayReadings.ino
Arduino sketch to demonstrate making current and voltage measurements with any number of supported INAxxx devices.
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.
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.
Overview
Installation
Class Instantiation
begin()
setI2CSpeed()
getBusMilliVolts()
getBusRaw()
getShuntMicroVolts()
getShuntRaw()
getBusMicroAmps()
getBusMicroWatts()
getDeviceAddress()
getDeviceName()
setMode()
setAveraging()
setBusConversion()
setShuntConversion()
reset()
waitForConversion()
conversionFinished()
alertOnConversion()
alertOnShuntOverVoltage()
alertOnShuntUnderVoltage()
alertOnBusOverVoltage()
alertOnBusUnderVoltage()
alertOnPowerOverLimit()