I'm programming a stm32 family 103 and I would like to measure some loads on the output of three channels with a sensor the INA3221. However, I'm trying to make it communicate with the TCA9548A multiplexer with address 0x70 (AO -> GND) and the INA with address 0x40 (AO -> GND).
The program is showing error "no matching function for call to 'INA3221::begin(ina3221_addr_t)' ".
C:\Users\User\Downloads\INA3221-main\INA3221-main\examples\get_started\get_started.ino: In function 'void current_measure_init()':
get_started:23:33: error: no matching function for call to 'INA3221::begin(ina3221_addr_t)'
ina_0.begin(INA3221_ADDR40_GND);
^
C:\Users\User\Downloads\INA3221-main\INA3221-main\examples\get_started\get_started.ino:23:33: note: candidate is:
In file included from C:\Users\Jefferson\Downloads\INA3221-main\INA3221-main\examples\get_started\get_started.ino:2:0:
C:\Users\User\Documents\Arduino\libraries\INA3221-0.0.1\src/INA3221.h:164:10: note: void INA3221::begin(SoftWire*)
void begin(SoftWire *SWire);
^
C:\Users\User\Documents\Arduino\libraries\INA3221-0.0.1\src/INA3221.h:164:10: note: no known conversion for argument 1 from 'ina3221_addr_t' to 'SoftWire*'
exit status 1
no matching function for call to 'INA3221::begin(ina3221_addr_t)'
As for the understanding of the logic, I even understood it, the only question is how am I going to call the slave so that the multiplexer loads the data and sends it to the microcontroller and ends with the ACK.
Because there are two interfaces, not just one, there are additional steps that you have to make in order to make the second port work. Please consult the Wire library documentation and examples from the STM core.
Why do you need more than one I2C port, anyway??? I2C is "plug and play" with the usual Wire library functions, on the port 1 pins.
Consult any of the 1,000,000 user sketches that do that.
I want to say that the alternative of doing it through hardware communication without a Wire.h library, didn't work. However, I tested it with the "SoftWire.h" library and managed to locate the addresses through a scan.
I want to say that the alternative of doing it through hardware communication without a Wire.h library, didn't work.
But you don't know why.
I see you are bound and determined to avoid a simple, common and reliable interface that thousands of people have used, right out of the box with no problems. Good luck with your project.