Skip to content

Commit 149a432

Browse files
committed
improve I2C init for ESP32
1 parent a35c8e4 commit 149a432

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Bosch_BME280_Arduino.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ int8_t BME::Bosch_BME280::begin() {
5151
dev.delay_us = &BME::Bosch_BME280::delay_us;
5252

5353
// SDA, SCL needed for ESPs
54-
#if ESP8266 || ESP32
54+
#if defined (ESP8266)
5555
Wire.begin(_sda_pin, _scl_pin);
56+
#elif defined (ESP32)
57+
Wire.setPins(_sda_pin, _scl_pin);
58+
Wire.begin();
5659
#else
5760
Wire.begin();
5861
#endif

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void loop() {
8787

8888

8989
## Compatibility
90-
* Tested with Arduino Nano.
90+
* Tested with Arduino Nano, ESP8266 and ESP32
9191

9292
## Copyright
9393
The Files:

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Bosch_BME280_Arduino",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Arduino Wrapper Class for use of BME280 Sensor based on the original Bosch Sensortec Driver",
55
"keywords": ["temperature", "humidity", "pressure", "bme280", "Bosch", "Sensortec"],
66
"authors":
@@ -11,5 +11,5 @@
1111
"maintainer": true
1212
},
1313
"franeworks": ["Arduino"],
14-
"platforms": ["atmelavr", "espressif8266"]
14+
"platforms": ["atmelavr", "espressif8266", "espressif32"]
1515
}

0 commit comments

Comments
 (0)