Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By tschaboo
#79572 I've got this board and an I2C breakout board for a BME280 sensor. Unfortunately my board uses pin D2/GPIO4 (which is a standard Arduino pin for I2C) for the included OLED. So I want to move the I2C bus to different pins. I heard that the ESP8266 supports I2C on any pins.

Unfortunately I can't find out how to do that in Arduino. According to the Arduino documentation for the wire library, there is now method to set the pins.

Any hints?
User avatar
By FreddyVictor
#79588 Arduino uses hardware i2c so must use specific pins so you won't get any help from that documentation

Just use the begin function and specify what pins you want to use - the function definition is:
void TwoWire::begin(int sda, int scl)

In future, look at the source files in the ESP8266 folder for help, though they may be hidden away on your pc...
I ended up creating separate installs for the ESP* boards using the portable (lookup as to how to do this) so the files are much easier to find

HTH
nb: I am a newbie so reserve the right to be totally wrong!
User avatar
By schufti
#79589 in general i2c is a _bus_ so intended to serve more than one device.
As long as there is no addressconflict between i2c devices there is no need for two buses.