Zanduino / INA

Combined Arduino library for reading multiple INA2xx power monitor devices
GNU General Public License v3.0
158 stars 41 forks source link

add ina237 support #88

Open ftyers opened 2 years ago

ftyers commented 2 years ago

Description

This is code to add support for INA237, from @ghcoleman who is working at Grobotic Systems. The code has been tested and works, but I do not have access to the testing environment.

I realise the PR is a bit bare and perhaps based on a version that isn't main. I definitely do not expect it to be merged as is, but I submitted it as it might be useful to someone in the future, for example the author of issue #78.

Fixes #78

Type of change

Checklist:

Limhes commented 5 months ago

The INA237-specific code in INA_Class::initDevice() does not compile here, because variables are declared after the case label. If the case statements are enclosed in an {} block, then it compiles.

jonbessette commented 2 months ago

The (RESOLVED BELOW) Hey Limhes - can you explain in a bit more detail where to place the {} block?

Screenshot 2024-09-10 at 12 47 53 PM

In the .cpp file, at what lines? Sorry, I can't seem to figure it out. Thanks!

jonbessette commented 2 months ago
Screenshot 2024-09-10 at 12 55 41 PM

Heck yeah, figured it out. Literally just as you explained... my apologies on the confusion. Literally after each case INAxxx

src.zip

e.g. case INA219: add a { at start and } at end of every single one of them.

I included the .zip of the working code with ina237