ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2k stars 638 forks source link

Dual displays #255

Closed prabbit237 closed 4 years ago

prabbit237 commented 4 years ago

This isn't an issue as much as a suggested change to the sample code. You have an example of using two different displays with the same I2C address on a single esp8266 but the sample is showing using 4 separate pins (and the esp8266 doesn't have as many GPIO pins as people would like.)

SSD1306Wire  display(0x3c, D3, D5);
SSD1306Wire  display2(0x3c, D1, D2);

But a quick test shows you can actually do it with three pins:

SSD1306Wire  display(0x3c, D4, D3);
SSD1306Wire  display2(0x3c, D2, D3);

That setup is working great on a NodeMCU v1.0 board and saved one pin (the project I'm working on was starting to run short on usable GPIO's and I didn't want to start grabbing the TX/RX pins.) Sharing the SDA and using separate SCL pins also works fine. So you may want to show both ways in the example code.

marcelstoer commented 4 years ago

Sure, why not. Can you prepare a PR for that maybe also mentions such a setup in the README?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.