Это видео недоступно.
Сожалеем об этом.
#21 Two Equal Displays on One Arduino I2C Bus (Tutorial)
HTML-код
- Опубликовано: 2 сен 2015
- In the previous tutorial I showed how to connect several devices to the same I2C bus. All devices had to be different (different sensors, different displays):
• #20 Tutorial: Multiple...
Here I show how you can connect two devices of the same kind to one I2C bus.
This needs a few steps more.
I use two Heltec SSD1306 OLED displays and a BMP085 for the demonstration.
The content can be also used for ESP8266 or for STM32 Boards like the Maple Mini.
Looks like I am 7 years late to this game. 😂Great video, now I can use both of my screens.
Some problems do not go away ;-)
This was very helpful to me, even though I am using a Nodemcu Lua devkit! I am using the cheap generic OLED displays from Ebay, but needed info on using two of them on I2C bus. Thanks!
You are welcome!
Is it possible to drive the third screen? Or shall I use SPI communication instead?
The I²C address on the OLED isn't doubled, rather each I²C device has two addresses, one for reading, one for writing.
To be precise, the address 0x3C is a 7-bit address. When you communicate, an 8th bit is added to indicate the direction, resulting in 0x78 and 0x79 addresses on the bus.
+Daniel Bos You are right, the 8th bit is used to indicate direction.Usually you do not have to care about it because the library knows this, too. This is, why the scanner sketch only shows one address per module.
Great work Andreas, This is exactly what I was looking for
:-)
Just excellent guide and tuition for me. Thank you so much.
You are welcome!
very nice , and though not the topic , i like how you hold the small OLED . I never thought to use my extra hand stand that way .
+XerotoLabs I am a lazy guy by birth! So I always search simple solutions...
Another great video! Thank you.
Would you consider adding your sketches in the future as an aid to some of us with limited programing experience? It helps me a lot to see how others code - especially if comments are included in the sketch.
Thank you again for your work. It is a lot of effort and greatly appreciated.
If there is anything to share you find the link in the description of the video. But not always ;-)
very useful and informative. Thanks
Hi, have you gotten this project to run in full resolution? I have done this but only in 128 x 32, when you try to run it in 128 x 64 it stalls and flashes between the 2 oled screens
I do not remember :-(
This is helpful if I wanted to do the exact same thing you are doing otherwise I still have no idea how to tell my Arduino how to find my devices by their addresses.
There are many tutorials on using I2C on Arduino
@@AndreasSpiess I know and they're all like yours lol turns out, I'm a noob and I didn't even need to specify the addresses of my devices because they already do that in their libraries so it was just a matter of setting up the I2C bus. Though I am still confused about pull-up resistors.
Andreas, thank you for the great video! I am trying to connect 10 identical 20x4 lcd displays to an Arduino to show the exact same information. I am not sure yet how to do this with I2C, but think it can be done after watching your video. Any ideas? Larry
Just try it with an increasing number. Then, you see, if you will experience problems. But you have to solve the problem of addressing. Most displays only support 2 addresses.
Where is the problem? If all should show the same then all connect to the same pins. Make sure that it is enough for everyone.
The 128x32 OLEDS I have don't appear to have anything to change the address, is there something I can bodge wire or a software solution?
Mine have an address selector on the back where you can change the address with a soldering iron
I have to use 4 of the same sensors at once... How do i do that?
Maybe you can change the address of the chip? otherwise, you have to use an I2C switch like the TCA9548A
Is it possible for a SSD1306 to get locked out and not display? Reason I ask is because I had a 1306 OLED working , I removed it and reinstalled it in a different Arduino nano , it no longer will display. I have checked the back of the display and there is a 662 voltage regulator on it , checking with a volt meter and 5vdc applied ,I get 5vdc to the top center and 3.3 to the lower pin and also ground. I checked the D1 with a Fluke meter and I get.535v in one direction and 1.88 v in the other direction.Thank you
I do not think that these OLEDs have any memory to stay locked after a power-cycle. So you either have a wrong sketch, a wrong connection, or a defective OLED. Just move it back to where it worked or replace ii with a different one and you will know if the OLED is defective.
Nice. Short & sweet.
:-)
Can i use this TCA9548A 1-to-8 I2C multiplexer for connecting 4no.s of mpu-6050 to an Arduino?
Maybe. But I assume the libraries do not work anymore. You can connect 2 6050 (you can choose between 2 addresses)
Can you share circuit diagram for two flow sensors and two oled connect in same nodemcuesp8266???? Help me
I am a RUclipsr and not a consultant :-(
Does this only work with the Adafruit_SSD1306 library?
I purchased some 1.54" OLEDs based off CH1116 (Advertised as SSD1309 on the listing) and I have only been able to control them using the Adafruit_SH1106G library so far.
This is fine and I can address both of my screens set to different addresses separately, but as soon as I have both display1 and display2 initialized the screens just spit out garbage... I've been looking at a whole lot of example code and trying lost of different variations and it works if I have either screen commented out but just wont play ball with both... It's doing my head in 😅
#include
#include
#include
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SH1106G display1 (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET)
Adafruit_SH1106G display2 (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
display1.begin(0x3c, true);
//display2.begin(0x3d, true);
display1.display();
//display2.display();
delay(2000);
display1.clearDisplay();
display1.setTextColor(1);
display1.setTextSize(1);
}
void loop(){
display1.println("test");
display1.display();
delay(1000);
}
1. Does the lcode work witth one display only?
2. Did you change the address of the second display (soldering)?
Yes I changed the address of the second screen and without making any wiring changes I can successfully address either screen, but when try to use both at the same time they both stop working @@AndreasSpiess
@@JshDav So it must be the library. Maybe you open an issue on their project?
Wiring diagram for two oled display in esp8266??
Same as with the Arduino.
Awesome, thats exactly what i was after
:-)
Just one question,
How can I attach more than 2
Should I use the PCF8574P or is there any other way to achieve this
Do you have the source code, I would like to take a look. Thanks
I do not have a source code, but I think, you can build your own sketch by adding the few lines of code shown in the video.
Andreas Spiess I was more interested to see how you read the data from the i2c sensor and send it to the displays. Thanks
Kann man auch 2 Unterschiedliche Oleds ansteuern? hab leider 0,91" oleds erwischt ohne Bus Jumper :(
Wenn beide die gleiche Adresse haben brauchst du zwei I2C Busse. Ein ESP32 hat das, sonst musst du mach „I2C Expander“ suchen
@@AndreasSpiess ok, danke dir :) werd mal danach schauen.
What if no resistor at all?
Usually this is not a good idea because the device will select one of the two address (and maybe even change it from time to time)
where do the pins of scl and sda of the oled go????
to the SDA/SCL pins of the Arduino
Excuse me, i have been working on a project and now i need to connect two BMP 180 to the same I2C bus.
How can i change the addresse?
Thanks!
The BMP180 has a unchangeable address. So, you can only attach one to your I2C bus. Ot you have to use I2C multiplexing. But then, the libraries will not work anymore.
:( Is there any problem if i connect one BMP180 and one BMP280?
Thanks
+Moisés Ram if they do not have the same address and if the libraries work together, this should work.
I am stuck in the same problem. +Moisés Ram , Did you find an alternative to it? I have already bought two BMP 180, didn't know if this will ever be the problem
This displays have only two different adress ?
How can I connect 5 dispalys OLED I2C to arduino ?
You can use something like that: learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
thank you Andreas!
it is nice idea
Thank you Andreas, this is what I was looking for. TCA9548a
can i use 1 esp and display to 3 OLED display? thanks
Why not? It also can use I2C
@@AndreasSpiess did you mean can do it without other module (TCA9548A, base other comment of this video)?
Thanks for sharing 😀👍
:-)
Is the code for this demo available?
+stevemke I put it on Github:
github.com/SensorsIot/Two-OLEDs-on-the-same-I2C-Bus
wish i could do this without desodering. i'll have to use a multiplexer
Also a good possibility if your library supports it.
Thank you so much
You are welcome!
Und wie macht man 2 LCD mit einem Raspberry Pi ? Bitte
Keine Ahnung. Noch nie versucht.
I need the code to connect the slaves. i am so glad when you send me the code
:-)
where is the source
There is none.
@@AndreasSpiess github.com/SensorsIot/I2C_1-Video
Bruh you saved my ass
:-)
You should check out your thumb with a doctor.
+Agustín Martínez I am glad that I still have it because it was nearly ripped-off my hand because it came between the chain and the cogwheel of my motor cycle. So, I have to live with it.
Nothing helpful 😎, only 2 displays. If you try to make it with 4 or 6 displays thinking it will be great.
Thanks for your feedback.
You can always use one of several other communication types to lots of displays. Such as SPI. Or even using shift registers to communicate with many displays.