There is a communication problem with the Heltec WiFi LoRa 32(V3), ESP32S3 + SX1262 and BME280 sensor that has internal pull-up resistors.
I scanned the I2C and the result is 0x76. I use pin 41 and 42.
I have already tried with new cables, changing the setClock speed, tested with other heltec devices and bme sensors and changing from 3.3v to 5v.
Some have written that it works properly only with pin 17 and 18, but I have also read about many others who could make it work with other pins so I wanted to ask you if there is something wrong with this code, if I may need to change libraries and/or maybe help me fix it.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#define BME_SDA 41
#define BME_SCL 42
#define BME_I2C_ADDRESS 0x76
TwoWire Wire2(1);
Adafruit_BME280 bme;
void setup() {
Serial.begin(115200);
Serial.println("BME280 ID Test");
Wire2.begin(BME_SDA, BME_SCL);
Wire2.setClock(100000);
if (!bme.begin(BME_I2C_ADDRESS, &Wire2)) {
Serial.println("Could not find a valid BME280 sensor!");
Serial.println("Check wiring and address.");
while (1);
}
Serial.print("BME280 Sensor ID: 0x");
Serial.println(bme.sensorID(), 16);
}
void loop() {
// Do nothing
}
Thank you in advance