INA icon indicating copy to clipboard operation
INA copied to clipboard

add ina237 support

Open ftyers opened this issue 4 years ago • 3 comments

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

  • [X] New feature (non-breaking change which adds functionality)
  • [X] This change requires a documentation update

Checklist:

  • [X] The changes made link back to an existing issue number

ftyers avatar Feb 15 '22 12:02 ftyers

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.

Limhes avatar Jun 17 '24 11:06 Limhes

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 avatar Sep 10 '24 16:09 jonbessette

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

jonbessette avatar Sep 10 '24 16:09 jonbessette