Skip to content

Commit

Permalink
improve I2C init for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
hasenradball committed Jul 13, 2022
1 parent a35c8e4 commit 149a432
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Bosch_BME280_Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ int8_t BME::Bosch_BME280::begin() {
dev.delay_us = &BME::Bosch_BME280::delay_us;

// SDA, SCL needed for ESPs
#if ESP8266 || ESP32
#if defined (ESP8266)
Wire.begin(_sda_pin, _scl_pin);
#elif defined (ESP32)
Wire.setPins(_sda_pin, _scl_pin);
Wire.begin();
#else
Wire.begin();
#endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void loop() {


## Compatibility
* Tested with Arduino Nano.
* Tested with Arduino Nano, ESP8266 and ESP32

## Copyright
The Files:
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bosch_BME280_Arduino",
"version": "0.0.4",
"version": "0.0.5",
"description": "Arduino Wrapper Class for use of BME280 Sensor based on the original Bosch Sensortec Driver",
"keywords": ["temperature", "humidity", "pressure", "bme280", "Bosch", "Sensortec"],
"authors":
Expand All @@ -11,5 +11,5 @@
"maintainer": true
},
"franeworks": ["Arduino"],
"platforms": ["atmelavr", "espressif8266"]
"platforms": ["atmelavr", "espressif8266", "espressif32"]
}

0 comments on commit 149a432

Please sign in to comment.