Skip to content

Improve example outputs #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2020
Merged

Improve example outputs #26

merged 3 commits into from
Dec 14, 2020

Conversation

WizardTim
Copy link
Contributor

  • Changed naming of 'PSU' and 'Load' voltages to 'VIN+' and 'VIN-' as I initially thought 'PSU' was referring to I2C logic level Vcc. I can't find any IN219 eval boards that don't used VIN+/VIN-. TI datasheet uses 'bus' and 'load' terminology in some circuit diagrams which might have influenced the choice?
  • Added power figures both from on chip register (lower resolution) as well as one calculated in Python using the full resolution voltage/current values
  • Align output in columns with correct significant figures
  • Added prompt if internal math calculations result in an overflow

Old

PSU Voltage:    3.292 V
Shunt Voltage:  0.003520 V
Load Voltage:   3.288 V
Current:        0.035200 A

New

Voltage (VIN+) :  3.292   V
Voltage (VIN-) :  3.288   V
Shunt Voltage  :  0.00352 V
Shunt Current  :  0.0352  A
Power Calc.    :  0.11574 W
Power Register :  0.115   W

With gain = DIV_1_40MV and _cal_value = 65535 to force a math overflow in current register.
New

Voltage (VIN+) :  3.128   V
Voltage (VIN-) :  3.088   V
Shunt Voltage  :  0.04000 V
Shunt Current  :  3.2767  A
Power Calc.    : 10.11845 W
Power Register : 10.118   W

Internal Math Overflow Detected!

- Changed naming of 'PSU' and 'Load' voltages to 'VIN+' and 'VIN-' as I initially thought 'PSU' was referring to I2C logic level Vcc. Not sure why previous names were chosen, I can't find any IN219 eval boards that don't used VIN+/VIN-.
- Added power figures both from on chip register (lower resolution) as well as one calculated in Python using the full resolution voltage/current values
- Align output in columns with correct significant figures
Would have liked to implement ADC overflow detection but no flag appears to exist for it
@ladyada ladyada requested a review from siddacious December 4, 2020 01:03
Copy link
Contributor

@siddacious siddacious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WizardTim works great, thanks for the improvements

@siddacious siddacious merged commit 2c0ea11 into adafruit:master Dec 14, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 17, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#2 from mcauser/patch-1
  > Removed deprecated pylint disable 'bad-whitespace'

Updating https://github.com/adafruit/Adafruit_CircuitPython_DHT to 3.5.2 from 3.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DHT#56 from yeyeto2788/fix_issue_32

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.4.2 from 2.4.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#32 from MattyJeronimo/mjeronimo/fix-cortex-m0-register-width-error

Updating https://github.com/adafruit/Adafruit_CircuitPython_INA219 to 3.4.6 from 3.4.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_INA219#26 from WizardTim/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD30 to 1.0.2 from 1.0.1:
  > fixing typo and adding i2c stop for register read

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.3.1 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#33 from FoamyGuy/pcf_examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants