My BME sensor does not show I2C pins such as SCL or SDA. The one I have looks to work with SPI protocols((SDO, SDI, SCK). I have tested a variety of permutations of wiring between the ESP 32 and the BME. I cant get the BME to say hello. Does this project and the libraries support BME 280 with SPI? I went through the forum. Sorry If i missed the answer, Thanks and Great Course!
4 Answers
Hi.
Yes, the libraries support SPI.
Wire the sensor as follows:
- SCK: GPIO 18
- MISO(SDO): GPIO 19
- MOSI (SDI): GPIO 23
- CS: GPIO 5
Add this to your code before the setup():
#include <SPI.h>
#define BME_SCK 18
#define BME_MISO 19
#define BME_MOSI 23
#define BME_CS 5
Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI
Delete this line:
Adafruit_BME280 bme; // I2C
And it should work.
Let me know if it works.
Regards,
Sara