I want to use different I2C pins for a BME280 temperature sensor as the default ones are already used.
Therefore I'm using the Wire library.
#include "Wire.h"
#include <Adafruit_BME280.h>
#define I2C_SDA 2
#define I2C_SCL 9
TwoWire I2CBME = TwoWire();
Adafruit_BME280 bme;
void setup() {
...
bool status;
status = bme.begin(0x76, &I2CBME); //This line causes the reset
if (!status) {
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
}else{
Serial.println("Conncted to sensor");
}
...
}
If I'm setting the I2C pins to 1 and 2 every works (except of the sensor ) any other pin causes a reset of the Controller and recall of the setup routine (in a loop)
Any idea? Which pins can be used for I2C (I'd prefer GPIO9 and 10)