Using the standard BME280 library i ran into a strange issue when trying to use the BME280 from a Mega2560.
Using the stadard library on a Nano the hardware SPI works OK.
Because the BME280 library is using more memory than average i switched to a Mega2560. Just replaced pins 10, 11, 12, 13 to the corresponding 53, 51, 50, 52.
Tried 2 Mega2560 boards. Both just no response at all.
Then switched from hardware SPI to software SPI:
BME280SpiSw::Settings settings(BME_PIN, BME_MOSI, BME_MISO, BME_SCK); BME280SpiSw bme(settings);
This is working fine.
NO clue what the issue is. If you ran into the same issue then atleast you have a workaround .
PS. I did have a levelshifter between the 5V mega and the 3.3V BME280 spi sensor!