Coder Social home page Coder Social logo

Comments (5)

jmfloyd avatar jmfloyd commented on August 22, 2024

(I hit return accidentally and it sent off the title!)
Suggest
Define constants for
MIN_SHUNT_VOLTAGE = const(0.00004)
MIN_BUS_VOLTAGE = const(0.008)

and use in code

This allows calling methods to compare values against the resolution available if needed

Like your version of the library. Much nicer.

Thanks John

from circuitpython_ina3221.

barbudor avatar barbudor commented on August 22, 2024

Hi @jmfloyd

I've added the 2 constants as:

# General constants
C_BUS_ADC_LSB                    = const(0.008)      # VBus ADC LSB is 8mV
C_SHUNT_ADC_LSB                  = const(0.00004)    # VShunt ADC LSB is 40µV

for both lite and full in this branch : https://github.com/barbudor/CircuitPython_INA3221/tree/pr_add_LSB_constants
Are you using lite or full ?

I don't have the time to setup a test platform, so could you please test and report back that I haven't broken anything ?

If this is ok, I will merge in the main branch.

Thanks for the suggestion.

from circuitpython_ina3221.

jmfloyd avatar jmfloyd commented on August 22, 2024

I have tested your changes and working as expected
John

from circuitpython_ina3221.

barbudor avatar barbudor commented on August 22, 2024

Closed by #4
Thanks

from circuitpython_ina3221.

barbudor avatar barbudor commented on August 22, 2024

Closed by #4
Thanks

from circuitpython_ina3221.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.