finitespace / BME280

Provides an Arduino library for reading and interpreting Bosch BME280 data over I2C, SPI or Sw SPI.
GNU General Public License v3.0
212 stars 105 forks source link

BME280 v3.0 not work with u8g2 and display HX1230_SW_SPI #115

Closed ruzanow closed 3 years ago

ruzanow commented 4 years ago

Sensor BME280 (with default address) connected to arduino I2C.

First - library BME280 v2.1 work without problem.

BME280 v3.0 normally work with graphics library u8g2 and OLED screens on I2C. But. BME280 v3.0 not work with u8g2 and LCD screen HX1230 on software SPI.

Expected behavior

With OLED: BME280.cpp BME280::ReadChipID() Serial.println(id[0]) = 96

Actual behavior

with LCD: BME280.cpp

BME280::ReadChipID() Serial.println(id[0]) = 10

Steps to reporduce the behavior

Here sketch Uncomment U8G2_HX1230.

ruzanow commented 4 years ago

Edit ReadChipID to always return true - no effect Old function ReadTrim() - no effect ( ord == 0 ) Add Wire.begin() to old ReadTrim() - partially work

ruzanow commented 4 years ago

Wire.begin(); in BME280I2C.cpp finally fixed this issue.

finitespace commented 3 years ago

Yes, the user needs to call Wire.begin()