Tinyu-Zhao / INA3221

Arduino library for INA3221 current and voltage sensor.
MIT License
14 stars 12 forks source link

Constructor is wrong #6

Open danny-miller opened 6 months ago

danny-miller commented 6 months ago

Constructor: INA3221(ina3221_addr_t addr) : _i2c_addr(addr){};

_i2c_addr is just a variable with a typedef for an integer, but () is initializing it like a class. I don't know what the compiler would do with () on a variable, it's not an array index This caused runtime memory errors for me so it may be trying to access it as a class with an undefined pointer?

Should be: INA3221(ina3221_addr_t addr) {i2c_addr=addr};