Giter Club home page Giter Club logo

Comments (7)

marcelbuesing avatar marcelbuesing commented on June 26, 2024 1

Ok I just added it to the SettingsBuilder as with_temperature_offset(i32). After looking at the code again the reason why I initially moved out t_fine was that I felt that the this enforces the order of function execution.

Temperature measurement can be enabled or skipped. Skipping the measurement is
typically not recommended since temperature information is used to compensate temperature influences in the other parameters. Datasheet

When looking at the calculation of the pressure and humidity it actually looks to me more like the temperature measurement must not be skipped.

E.g. in the C library the order of execution affect the results of
L887/L903

What do you think about this and would you mind giving the code a try ? It's located in the offset branch.

from bme680.

nickbroon avatar nickbroon commented on June 26, 2024

I thought about adding a t_fine member to the CalibData struct, and modifying that with an offset (basically just doing the same as python code does in the previous mentioned links), but I've noticed in the commit below, that such a member previously existed but was removed and instead t_fine was explicitly passed to temp/pressure/humidity function instead. Was there reason for removing t_fine from the CalibData struct? Would be acceptable to add it back, and then modify it with new adding temp_offset setting?

6b6e19b#diff-b4aea3e418ccdb71239b96952d9cddb6L229

from bme680.

marcelbuesing avatar marcelbuesing commented on June 26, 2024

Hi nick, sorry for the slow the response. I'll try to check this in the next days, thanks for digging in the commits. It does sound like a good suggestion though.

from bme680.

nickbroon avatar nickbroon commented on June 26, 2024

I've had a look over https://github.com/marcelbuesing/bme680/compare/offset and this should work fine. I agree that it appears that order appears to be import in both the C and Python implementations with t_fine being an output from temperature calculation and an input for pressure/humidity. Storing it in calibration data can make appear as if pressure/humidity can be calculated independently from temperature, but your approach makes them explicitly dependant which I think is better.

from bme680.

marcelbuesing avatar marcelbuesing commented on June 26, 2024

Thank for looking at this! I've just released 0.4.0 containing the change.

from bme680.

marcelbuesing avatar marcelbuesing commented on June 26, 2024

Would you mind looking at the fix again? Sorry for this. It actually also fixes the else instead of else if case (offset > 0) that was corrected later in the python merge request.

from bme680.

marcelbuesing avatar marcelbuesing commented on June 26, 2024

Well I had to get creative, since there does not seem to be a copysign fn for i32, but I think this should do the job.

from bme680.

Related Issues (14)

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.