Posts: 85
Joined: Thu Dec 24, 2015 8:34 pm

I2C, ready condition?

Tue Oct 09, 2018 4:25 pm

I have a BME280 connected via I2C. In order to read the sensor's measures I use this program from a mate:
Everything works fine if invoked some time after boot. Invoking the program in rc.local results in false readings. I could noct figure out, what time is needed to ensure proper operation, that is
  • Enable sensor
    Read the calibration registers of the sensor.
    Read concurrent measures.
Since I can't figure out, what time is needed:
Is there a ready condition of the whatever I2C driver existing, an I2C ready query? What is the code "sensorics" missing?

Return to “C/C++”