enjoyneering / ESP8266-I2C-Driver

Fixed built-in I2C driver for Arduino ESP8266 core
76 stars 18 forks source link
esp8266-arduino i2c i2c-bus i2c-driver wire

license-badge stars hit-count github-issues

ESP8266-I2C-Driver

Fixed built-in Master I²C driver for Arduino ESP8266 core. Sorry it doesn't support slave I²C mode.

Board SDA SCL Level
ESP8266 GPIO4 GPIO5 3.3v/5v
ESP8266 ESP-01 GPIO0/D5 GPIO2/D3 3.3v/5v
NodeMCU 1.0, WeMos D1 Mini GPIO4/D2 GPIO5/D1 3.3v/5v

Copy and replace "twi.h", "core_esp8266_si2c.cpp" in folder %USERPROFILE%\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266

Copy and replace "Wire.h", "Wire.cpp" in folder %USERPROFILE%\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\Wire

If you want to keep the original files - just change the file extension* to "twi.h.OLD" and etc. Then you always can go back.

*if you change the file name you get an error at compile time

Special thanks to Tech-TX(StanJ)