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

setAlertPinOnConversion()

Arnd edited this page Jun 22, 2018 · 3 revisions

setAlertPinOnConversion(State[,deviceNumber]);

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

Set alert pin as specified below for the device given in "deviceNumber"; setting all devices if the "deviceNumber" parameter is omitted.

This function accepts a boolean argument which activates changing state on the ALERT pin (pin 3 in 10-Pin VSSOP package). The pin is open drain so should be pulled high with either an external resistor or by using the Arduino call "pinMode(,INPUT_PULLUP);". When a conversion is complete the INA226 will pull this pin down to ground. The state will remain set until either the configuration register is read or the Mask/Enable register is read. The simplest means to reset the state is to call waitForConversion() which will read the Mask/Enable register and will also return immediately without waiting, since the conversion is complete when the function is called.


Example:

A complete example program using this call and Arduino IDE pin-change interrupts can be found in the source code and documented at BackgroundRead

Clone this wiki locally