Using two current sensors (ina219), how to write the code?

A4 and A5 are the only I2C connections.
Refer below page 8 on selection of different address for your 2 sensors.
https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ina219-current-sensor-breakout.pdf

As above DC not AC measurement.

Hi. @bergerino

You have two I2C devices with DIFFERENT addresses, why have you got them on separate inputs?
The reason for two DIFFERENT addresses is so you can operate BOTH on the same I2C bus.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Yeah exactly. Someone else suggested before, i just didn't know you should put them both in the same pin and solder them to change their address. I haven't got the chance to test this out yet but probably that's the problem

Why do you use two different addresses here, 0X40 and 0X41.
Which address are they both setup for?

If you have not soldered any pads then BOTH sensors will be 0X40.

Adafruit_INA219 ina219_5(0x40);
Adafruit_INA219 ina219_12(0x40);

Tom.. :smiley: :+1: :coffee: :australia:

Got it! I've soldered A0 with my shitty soldering skills, but it works! Thanks alot everyone