Hi Kenny22,
We are not familiar with your hardware platform and software environment. You can refer to the official BME280 sensor API and example code https://github.com/boschsensortec/BME280_SensorAPI to check for any differences between your code and the reference code.
... View more