stevemarple / SoftWire

Software I2C implementation for Arduino and other Wiring-type environments
GNU Lesser General Public License v2.1
136 stars 31 forks source link

Softwire and Heltec OLED #17

Closed gsmith255 closed 3 years ago

gsmith255 commented 3 years ago

Hi,

I'm tring to use SoftWire to connect to BME280 on a heltec wifi kit32. If I use soft SDA SCL (GPIO_4,GPIO_15) respectivley it works fine. (note the I2C OLED diplay is connected to 4,15 When I move the BME280 to two other GPIO's (21,21) it work fine until i call the SDD1306 lib display.init() command. This appaers to set the SoftWire pins back to (4,15) Does this mean I cant use SDD1306 and SoftWire on differnet pins?

Nice library btw .. Thanks

stevemarple commented 3 years ago

I'm not sure exactly what you are trying to do here. It sounds like you are trying to have SoftWire create two independent I2C buses. If so then you need two separate instances of SoftWire, so something like

SoftWire i2c1(4, 15);
SoftWire i2c2(20,21);

Each bus needs separate pins. I trust (21,21) is just an error in your description.