Giter Site home page Giter Site logo

Comments (6)

forKnowYou avatar forKnowYou commented on August 16, 2024

Sorry for late reply.
It's my pleasure to receive your advise.
We have tested and found that the library cannot read registers when the sentence been removed.

from dfrobot_bme680.

Koepel avatar Koepel commented on August 16, 2024

I mean the last Wire.endTransmission(); in the function readReg(), not the one that is used to write the register address to the chip.

Are you saying that reading the registers before that line can not be done if that line is removed ?

The Wire.endTransmission() should only be used when writing data. It should not be used after a Wire.requestFrom(). That is how the Wire library works. That is how the documentation is.

In case you did remove the right line: It will cause an extra delay, perhaps that is needed. When the Wire library for AVR chips is used, a Wire.endTransmission() on its own puts the sensor address on the I2C bus and the sensor acknowledges that. However, that behaviour can change since it is not documented and should not be used like that.

from dfrobot_bme680.

forKnowYou avatar forKnowYou commented on August 16, 2024

You mean the line 106 in DFRobot_BME680.cpp right?
We had try to removed it, and it looks like BME680 need that single.
I am a yong engineer, thanks for your explanation. I will do more exploration.

from dfrobot_bme680.

Koepel avatar Koepel commented on August 16, 2024

No, line 112.
That is after the Wire.requestFrom().

To write data, the functions Wire.beginTransmission, Wire.write and Wire.endTransmission are used. Those three belong together.
To read data, only the function Wire.requestFrom is used. After that, Wire.available and/or Wire.read can be used, but Wire.requestFrom does the complete I2C transaction on its own.

from dfrobot_bme680.

forKnowYou avatar forKnowYou commented on August 16, 2024

Understood, thanks.

from dfrobot_bme680.

Koepel avatar Koepel commented on August 16, 2024

I see the issue has been solved. I will close this issue.

from dfrobot_bme680.

Related Issues (19)

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.