adafruit / Adafruit_INA219

INA219 Current Sensor
Other
204 stars 145 forks source link

Triggered mode #23

Closed mrguen closed 6 years ago

mrguen commented 6 years ago

Hello,

This modification of the code allows triggered mode.

Added a "bool triggered = false" parameter to calibration routines.

I am sorry all lines seem to be modified due to end of line difference. I work on Windows 7 / textPad (Unix encoding). If you know how to correct this tell me.

Sincerely

ladyada commented 6 years ago

hiya, please add some documentation notes so that travis passes :) then, do you have an example code that shows how this is useful?

mrguen commented 6 years ago

Hello Ladyada,

I will wait for issue 24 to be resolved before subimitting again. I would provide an example: I use it on a PowerMeter board and want to have the measurement to happen once (with max averaging) between sleep periods.

I also consider adding a 32V 400 mA calibration routine:

I don't get why 16V 400 mA says "set device to alibration which uses the highest precision for current measurement (0.1mA), at the expense of only supporting 16V at 400mA max."

I don't see an impossibility to set the max voltage at 32V.