Seeed-Studio / Wio_Link

Wio_Link 8266
http://seeed-studio.github.io/Wio_Link/
181 stars 64 forks source link

Unable to get value from SHT-31 #76

Closed matsujirushi closed 1 month ago

matsujirushi commented 3 years ago

The sunlight sensor is connected to I2C0, and the SHT-31 is connected to I2C1. When I try to get the humidity of SHT-31, I get an "unknown reason" error.

image

matsujirushi commented 3 years ago

It seems that multiple I2C buses cannot be used at the same time because SDA and SCL are static variables.

https://github.com/Seeed-Studio/Wio_Link/blob/master/esp8266_arduino/Wire.cpp#L58 https://github.com/Seeed-Studio/Wio_Link/blob/master/esp8266_arduino/core_esp8266_si2c.c#L64 https://github.com/Seeed-Studio/Wio_Link/blob/master/esp8266_arduino/core_esp8266_si2c.c#L26

The latest version of Arduino core for ESP8266 seems to correct this.

https://github.com/esp8266/Arduino/blob/master/cores/esp8266/core_esp8266_si2c.cpp#L67