I have this breakout board http://adafruit.com/products/904 .
I have it up and running on an arduino UNO board, and so far it is working great.
However, I am a bit new to all of this and I need some advice for modifying the code to get more resolution at lower currents. According to the web page:
A precision amplifier measures the voltage across the 0.1 ohm, 1% sense resistor. Since the amplifier maximum input difference is ±320mV this means it can measure up to ±3.2 Amps. With the internal 12 bit ADC, the resolution at ±3.2A range is 0.8mA. With the internal gain set at the minimum of div8, the max current is ±400mA and the resolution is 0.1mA. Advanced hackers can remove the 0.1 ohm current sense resistor and replace it with their own to change the range (say a 0.01 ohm to measure up 32 Amps with a resolution of 8mA)
I am assuming that the example code I am using sets the chip up to read a span of ±320mV, and thus report a ±3.2A range, I would like to know how to send the commands to reset the internal gain to minimum (1) so that I can get a ±400mA range instead.
I have looked though the .h and .cpp files, and they seem to be well commented, but it is a little over my head, as i am fairly new to the arduino.
The example sketch simply initiates the chip with the "ina219.begin();" in setup, then starts communication with the chip and reading values. I am assuming that the library actually sets the gain and voltage range via this command.