We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
List of commands (public functions) of the INA219_WE library
Function Parameters what it does
initiates the INA219 with some default register values; bool Init( ) none returns true, if the INA219 is connected.
void reset_INA219( ) none reset of the device
if INA226 current values differ from currents measured with
void setCorrectionFactor( factor ) factor (float) calibrated equipment, you can apply a factor BIT_MODE_9 BIT_MODE_10 BIT_MODE_11 sets the ADC mode for shunt and bus voltage conversion BIT_MODE_12 SAMPLE_MODE_2 BIT_MODE_X: single measurement with x bit resolution void setADCMode( mode ) SAMPLE_MODE_4 SAMPLE_MODE_8 SAMPLE_MODE_X: average of X measurements SAMPLE_MODE_16 SAMPLE_MODE_32 SAMPLE_MODE_64 SAMPLE_MODE_128 sets continuous or triggered mode, but also power down or POWER_DOWN switches ADC off TRIGGERED void setMeasureMode( mode ) ADC_OFF for POWER_DOWN please chose "powerDown" function CONTINUOUS since it saves the configuration PG_40 sets the PGain value; the number is the maximum shunt PG_80 void setPGain( gain ) voltage in mV. Using PG_320 and a 0.1 Ohm shunt sets the PG_160 current range to 3.2 amperes. PG_320 BRNG_16 void setBusRange( mode ) bus voltage range 0-16 Volt / 0 - 32 Volt BRNG_32 Define the shunt size in case you don't use a shunt of 0.1 void setShuntSizeInOhms( size ) shuntSizeInOhms (float) ohms, which is the standard on modules. People have reported offsets, i.e. there is a shunt voltage void setShuntVoltOffset_mV( offset ) offset in millivolts (float) although there is no current (load switched off). The function will correct the current and power.
float getShuntVoltage_mV( ) none delivers shunt voltage in mV
float getBusVoltage( ) none delivers bus voltage in mV
float getCurrent_mA( ) none delivers current in mA
float getBusPower( ) none delivers the power in mW
delivers "true" if an overflow occurs in one of the data
bool getOverflow( ) none registers starts single shot measurement and waits until data is void startSingleMeasurement( ) none available void powerDown( ) none switches the module off and saves the configuration before switches the module on after Power Down and writes back void powerUp( ) none the configuration (modes, gains, etc)