Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. nbenm
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by nbenm

    • RE: BMP280 + I2C

      @emc2 said in BMP280 + I2C:

      @marekd glad it was useful.

      You may not need to change the address in the library.
      If you add these 2 lines after #include <Adafruit_BME280.h> it should work without modifications of the library and so survive any future library updates.

      #undef BME280_ADDRESS         // Undef BME280_ADDRESS from the BME280 library to easily override I2C address
      #define BME280_ADDRESS (0x76) // Low = 0x76 , High = 0x77 (default on adafruit and sparkfun BME280 modules, default for library)
      

      Thanks for this good idea, but it doesn't always work.
      It's better to add the define before the include, in the sketch.
      And to replace in the lib
      #define BMP280_ADDRESS
      by
      #ifndef BME280_ADDRESS
      #define BME280_ADDRESS (0x77)
      #endif
      Of course if library updates...

      posted in My Project
      nbenm
      nbenm