Тёмный

Using Multiple Displays with Arduino FREE CODE 

Kris Kasprzak
Подписаться 21 тыс.
Просмотров 67 тыс.
50% 1

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 112   
@TactlessWookie
@TactlessWookie 7 лет назад
An easy way to see the I2C addresses on the displays (or other I2C devices) is to load the I2C scanner sketch and look at the serial monitor. Nice little tutorial.
@scootergem
@scootergem 3 года назад
BLESS YOU! i have been working on getting a project going for weeks and now because of you, it's working! you explained it and I felt confident with the knowledge you imparted. it still didn't work, but because of my new found confidence, I decided to get a fresh copy of ssd1306.h. and everything began to work! THANK YOU! one note in the lines where you are doing the 'display2...display2...display2...display2...display2...' there's a line in there that says 'display1...' thought you'd like to know although you've probably had a zillion calls on it already. anyway, kudos and I'm going to subscribe twice - once for display1 and again for display2...
@rallymax2
@rallymax2 3 года назад
I suspect that flicker you’re seeing on your screen is because of the failed ack from the Oled after each message you send to it in the .display() method. This causes it to not be immediately ready for the next transaction. I had this problem too until I added some 4.7 K pull up resistors on the SDA and the SCK lines. I hope that helps.
@Taran72
@Taran72 5 лет назад
WOW! Thank you so much! this is a great video. As always, after you explain it and provide the code it's extremely simple to do. :)
@jakehealthx
@jakehealthx 2 года назад
Extremely interesting and helpful. Thank you!
@KrisKasprzak
@KrisKasprzak 2 года назад
You're very welcome!
@DavidRisnik
@DavidRisnik 2 года назад
Thanks for the very detailed explanations Kris !. It was very useful for my project. thanks
@Flynn3778
@Flynn3778 7 лет назад
Worked perfectly! What a great bit of clean code.
@KrisKasprzak
@KrisKasprzak 7 лет назад
You're very welcome. Glad I could help.
@TGameMaster1993
@TGameMaster1993 6 лет назад
I found a little mistake in the conversion from HEX to binary. Actually a misplacement of the addreses. 0x7A corresponds to 01111010 in binary and 0x78 is 01111000 in binary. So you have swaped them by mistake. Not a big problem, anyway, great tutorial!
@CrazyCoupleDIY
@CrazyCoupleDIY 6 лет назад
Just noticed that too
@MEan0207
@MEan0207 5 лет назад
Absolutely
@kawawangkowboy9566
@kawawangkowboy9566 4 года назад
You can also skip the intermediate conversion and just say const uint8_t address = 0x7a >> 1;
@jakehealthx
@jakehealthx 2 года назад
Yes I saw that too.
@LuisHernandez-ev5ho
@LuisHernandez-ev5ho 2 года назад
Excellent explanation, clean and simple
@KrisKasprzak
@KrisKasprzak 2 года назад
Glad it was helpful!
@user-wv4nk3eb4n
@user-wv4nk3eb4n 5 лет назад
Thank you very much~you save my project!!
@kristinwagoner6688
@kristinwagoner6688 3 года назад
Very helpful! Thanks for posting your work here
@KrisKasprzak
@KrisKasprzak 3 года назад
Glad it was helpful!
@TheWhitde
@TheWhitde 7 лет назад
Can use more than 2 if use SPI ones as each will have it's own CS line. OK... uses more pins but could use a port expander etc if pins are tight. Also find SPI ones have a faster SCK rate.
@KrisKasprzak
@KrisKasprzak 7 лет назад
good tip.
@DitheryStudios
@DitheryStudios 4 года назад
How many can you use?
@kd_rowdy_boy
@kd_rowdy_boy 5 лет назад
What is the maximum limit of Arduino mega handling oled screens i want ro use 30 oleds so how much current and power dissipation of the whole system would be? And are rgb oleds available
@billswan9395
@billswan9395 5 лет назад
I got the sketch working, but can't get to 128 x 64 pixel mode, only 128 x 32 pixel mode. As I am weak with library editing, I could use some help there. I have Notepad++ and have edited libraries, but am having trouble with the "new" constructors. Thanks!
@KrisKasprzak
@KrisKasprzak 5 лет назад
Open a file called Adafruit_ssd1306.H. notepad will be a fine editor. Look for these lines near the top of the file and make sure this line is not commented out. Make sure similar ones are commented out though. Save the file and restart the Arduino IDE. #define SSD1306_128_64
@mac1mike
@mac1mike Год назад
all kinds of issues with your free sketch, i'm a beginner but I compared your scrolling circles sketch with another simple sketch with dual display with only had text, combining the 2 and modifying your sketch I got the circles to scroll otherwise the circles did not jump to display 2 at all.
@phmaximus
@phmaximus 6 лет назад
Awesome buddy, thanks. hey quick question, the screen i have have the resistor on the other address, and it made me wonder rather than using a blob of solder are u meant to move the resistor?
@KrisKasprzak
@KrisKasprzak 6 лет назад
the resistor is a 0 ohm, which is basically a blob of solder. I found it impossible to move the tiny resistor.
@davidjackowski4336
@davidjackowski4336 6 лет назад
My resistor was four hundred something. Im going to pretend it was 0. Hopefully I dont let the magic blue smoke out!
@mytechexplanations6923
@mytechexplanations6923 4 года назад
Awesome...👍👍
@StarStudios007
@StarStudios007 6 лет назад
I used our code....and same wire connection as u do....but I am getting only display2 text displayed in both displays.....0x3d address not working....same oled displays used
@cekpi7
@cekpi7 5 лет назад
You have resistor on back of the display where you change it's adress, if they are on same adress it will show same thing on both of them. Desolder it and solder to second pad on one of the displays.
@CrazyCoupleDIY
@CrazyCoupleDIY 6 лет назад
Is there a way to connect more than 2 displays
@KrisKasprzak
@KrisKasprzak 6 лет назад
Crazy Couple yes and no, the yes is all you need to do is find another display with a unique address, the no part is I've never been able to find one other than 0x 3 C and 0 x 3D
@CrazyCoupleDIY
@CrazyCoupleDIY 6 лет назад
Cool I think Multiplexer TC9548 can be used to achieve this. I havent tried it yet may give it a shot and see if i can get a success :)
@CrazyCoupleDIY
@CrazyCoupleDIY 6 лет назад
I have just found the solution to this, I have successfully tested it with 8 displays. I will make a tutorial on this soon :)
@akspe22mam
@akspe22mam 6 лет назад
Please, can you give me an aproach of what you did? Did you use the multiplexer?
@CrazyCoupleDIY
@CrazyCoupleDIY 6 лет назад
Check this out: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_e_0HJY0uIo.html
@fabricio.ferrari
@fabricio.ferrari 5 лет назад
Thanks for the help. There is a typo in the code Display2.setTextSize(2); Display2.setTextColor(WHITE, BLACK); Display2.setCursor(0, 0); Display2.println("Display 2"); Display1.fillCircle(i - 127, 30, 10, 1); //
@D-One
@D-One 4 года назад
Thanks for sharing this, i thought i had done something wrong. 👍🏽
@uwesmodellbau8295
@uwesmodellbau8295 3 года назад
Sehr gute Darstellung und sehr lehrreich. Aber auf der Folie (Zeit 1:39) ist da nicht die Bit verdreht - was rechts ist gehört nach links und umgekehrt. Einfach die erste Zeile vertauschen!
@tomaszpatelczyk3511
@tomaszpatelczyk3511 5 лет назад
I'm also trying to use your code, but I've got only one display on and it's flashing, with the circle at the start. I can swap them changing C with D in the code, and I2C scanner does show both devices. I have tried on Uno, Nano, different displays, but nothing is changing. Are you sure this code works?
@SpectraLzz
@SpectraLzz 5 лет назад
I've got the same problem! Have you figured it out?
@dr1o1
@dr1o1 5 лет назад
@@SpectraLzz I had this issue, it seems the updated Adafruit library no longer works with this code. don't ask me why, still learning to use my Arduino. but if you change the library version to 1.2.7 it should work. it did for me at least. kris Kasprzak if you see this, might be worth throwing a note up on the video?
@BramStolk
@BramStolk 4 года назад
How much time does a display update take? Is it done in the background, or does the Display1.display() block the main thread?
@KrisKasprzak
@KrisKasprzak 4 года назад
Display() sends the buffer to the display, so yes everything is blocked , except hor interrupts.
@carnilean
@carnilean 4 года назад
So great Kris! I am using this as a base for monitoring AC current...but 60Hz is low and doest fit the full wave on the 128x64. I am attempting to modify to "Zoom" out to see more waves...any tips?
@carnilean
@carnilean 4 года назад
Solved it...I modified the display.drawLine function :)
@KrisKasprzak
@KrisKasprzak 4 года назад
This may be hokey but in the read Loop put in a delay maybe microseconds an experiment with the values.
@AlexTango
@AlexTango 8 лет назад
awesome dear, need new video, go forward - super!
@KrisKasprzak
@KrisKasprzak 8 лет назад
You're very welcome.
@joniboy0782
@joniboy0782 Год назад
What is the maximum amount of screens that you can connect with an arduino? Would 6 be alright?
@KrisKasprzak
@KrisKasprzak Год назад
It depends on how many different addressable displays you can find. I've only been able to find 2.
@mav29
@mav29 4 года назад
thx thx thx
@gpenn9225
@gpenn9225 3 года назад
can i use this for 2 display 3,5 inches?
@ajayshokal7193
@ajayshokal7193 2 года назад
I got bit error with dual OLED interface with Arduino....i got blink only one OLED
@KrisKasprzak
@KrisKasprzak 2 года назад
can you be more specific?
@digitalmunky
@digitalmunky 4 года назад
I'm interested in connecting 5 displays in a single project. All 5 displays would show a different image which would fade in and out between 2 images... Is this possible using a single controller or am I forced to utilize more than one?
@KrisKasprzak
@KrisKasprzak 4 года назад
Possibly but may need different displays, MCU and library. The library used here creates a video buffer in memory the writes the buffer to the screen. Those little arduinos will probably not have enough memory for 5 displays. 2 is pushing it. A Teensy 3.2 has 256K of memory and should work just fine. Now for the displays....if I2C based, you will need to find 5 different addresses (depending on the lib) or use an i2c scanner to get each displays address--again it may be hard finding different addresses. If you move to SPI displays, display writing is controlled via a chip select pin. Depending on the controller you may need to use special pins for the unique chip selects. I feel this is possible by not with the code i'm showing here.
@harryohanson
@harryohanson 3 года назад
Can you double the amount of displays signing a different output from Arduino for the other pair?
@KrisKasprzak
@KrisKasprzak 3 года назад
These are I2C based, so if your MCU has a second bus, maybe?!?
@davidalexander9895
@davidalexander9895 8 лет назад
Forgive me for I am new to Arduino but could you use what you have done here to create a large screen and map the content across lots of screens to create one much larger screen of similar aspect ratio?
@KrisKasprzak
@KrisKasprzak 8 лет назад
You could but you need to find displays that have programmable address. the ones I show here only have 2 settings, so if you wanted to use say 3 x 3 for 9 displays, these would not work. I'm not sure if any exist that have that much flexibility. If you need say 480 x 320, those displays exist or even 7 inch displays.
@tablatronix
@tablatronix 7 лет назад
Yes you can but you will need to use seperate i2c buses or you can do clever external select swapping on spi. To use seperate i2c buses tou will have to have enough pins and modify the wire library to support pin asssignment or constantly swap pins in software. Or just write your own low level code
@victororo462
@victororo462 2 месяца назад
Ever think of making these display the information of bat chirps?
@EndlessSoundscapes
@EndlessSoundscapes 7 лет назад
I have a project that need to display up to 36 display panel, do you think it is possible if I were using Arduino Mega and port expander?
@igrewold
@igrewold 6 лет назад
How many ports per display? drop 2 each(VCC, GND), these can be re-used among displays (power/watt restrict #) it seems you need 2(SCL, SDA) x 36 = 72 ports. You need to calculate also how much power(wattage = volt x amp ) each display consumes or get it from datasheet. Just try it and please post findings on INSTRUCTABLES. title: Max # of Displays that Arduino Can Run www.instructables.com
@igrewold
@igrewold 6 лет назад
+LS this could be useful to you: #20 Tutorial: Multiple Devices on One Arduino I2C Bus ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QQLfzlPGjjE.html
@worldexplorerPL
@worldexplorerPL 2 года назад
Hi Kris, how do I change the address of the second display to a non-factory one?
@KrisKasprzak
@KrisKasprzak 2 года назад
The displays are use have tabs on the back where you can select one address or another I have yet to see a display where you can program the address.
@worldexplorerPL
@worldexplorerPL 2 года назад
@@KrisKasprzak THX
@Thecrazytv3
@Thecrazytv3 11 месяцев назад
I want add 4 display how change address
@KrisKasprzak
@KrisKasprzak 11 месяцев назад
All the displays I’ve seen have a fixed address with only two settings.
@alexandruciobotaru2018
@alexandruciobotaru2018 2 года назад
Is it realy not possible to do if i dont have a adress changer? I have a project to do for school and i need to know if 2 RB-TFT1.8 can work on a ESP32
@KrisKasprzak
@KrisKasprzak 2 года назад
If your displays are I2C then you may be able to scan the address of each device to see of they are different. If there is no hardware selection, I suspect they will be the same. If you need multiple displays use SPI type (ILI9341 drivers for example), SPI have a chip select pin for communicating to each display. You may be able to use a multiplexer chip to communicate to multiple SPI displays.
@alexandruciobotaru2018
@alexandruciobotaru2018 2 года назад
@@KrisKasprzak I looked up and my displays are SPI thx for the help
@wasanthawimaladharm
@wasanthawimaladharm 3 года назад
does 2 Nokia LCD can use like this project after change address
@KrisKasprzak
@KrisKasprzak 3 года назад
Just as long as they are standard i2c Communications you should be able to
@wasanthawimaladharm
@wasanthawimaladharm 3 года назад
@@KrisKasprzak can you demonstrate by your channel video or describe how we can do that
@ET2carbon
@ET2carbon 4 года назад
I need like 32 of these run horizontally to make titles in an audio mixer. How can I start
@KrisKasprzak
@KrisKasprzak 4 года назад
Not sure how you will distinguish one from the other. I've never seen programmable addresses. Also forget using an Arduino--not enough memory. Switch to a Teensy.
@ET2carbon
@ET2carbon 8 месяцев назад
​@KrisKasprzak hi I'm checking back with you, any fresh updates?
@PilatusPorterPC6
@PilatusPorterPC6 6 лет назад
I have some without the address on the back but.....there are 2 zero ohm resistors with a common center and labeled r3+ r4+ r4-r3-. I am thinking these may change address? I am going to try it and check it with i2c scanner. I may blow it but hey, a few dollars : )
@KrisKasprzak
@KrisKasprzak 6 лет назад
I'm guessing you are right, let us know and the source. I've been looking for OLED's with more than 2 addresses.
@PilatusPorterPC6
@PilatusPorterPC6 6 лет назад
Well, I found a complete data sheet (I think on Adafruit.) It looks like r3, r4 and r8 are just used to select spi, I2C. Darn : ( .......The data sheet does show all the pins so I hope there will be a way to flash a new address to them? Here is link to advanced data sheet..... cdn-shop.adafruit.com/datasheets/SSD1306.pdf
@KrisKasprzak
@KrisKasprzak 6 лет назад
I believe the adafruit lib also supports SPI interfaces, maybe this displays supports SPI?
@PilatusPorterPC6
@PilatusPorterPC6 6 лет назад
I am looking into these. Adafruit and/or Ebay. learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
@KrisKasprzak
@KrisKasprzak 6 лет назад
I've never used those, but I'm guessing they will work. Thanks for sharing!
@mariaviklund4546
@mariaviklund4546 3 месяца назад
Copied the code and tried it but the ball stays in display one. Hmm
@KrisKasprzak
@KrisKasprzak 3 месяца назад
On the back of each display, what is its address?
@mariaviklund4546
@mariaviklund4546 3 месяца назад
@@KrisKasprzak One is set to 0x3C and the other is 0x3D. The text shows up correctly for display 1 and 2 but the little ball stays in display 1, looping around.
@juliocoq777
@juliocoq777 3 года назад
👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍
@fandihayu
@fandihayu 7 лет назад
how many address it can be configured?
@KrisKasprzak
@KrisKasprzak 7 лет назад
This display, only 2 and i've not found any others that are other than 0x3C or 0x3D. If you find a source, please let us know.
@bdjeosjfjdskskkdjdnfbdj
@bdjeosjfjdskskkdjdnfbdj 6 лет назад
is it possible to do this without the breadboard?
@KrisKasprzak
@KrisKasprzak 6 лет назад
Do you mean create your own PCB's? Sure is.
@igrewold
@igrewold 6 лет назад
+jia chen, You can use dupont wires/jumpers fe/male to fe/male (f2f, m2m, "f2m" ), get all sets in 1 kit. duckduckgo.com/?q=+Dupont+Jumper&iax=images&ia=images v.ht/dupont And do this/these trick(s) : ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eI3fxTH6f6I.htmlm29s
@TCBEperformance
@TCBEperformance 7 лет назад
I thought 0X78 is a 7bit number!
@harshmudgil4140
@harshmudgil4140 5 лет назад
I want to use 2 displays as 1.
@KrisKasprzak
@KrisKasprzak 5 лет назад
you can, watch the moving circle from disp1 to disp2 at the 0:03 mark. YOu just need to the do the math to reset the graphic item to 0 for disp2 when the graphic item hits the width limit of disp2
@harshmudgil4140
@harshmudgil4140 5 лет назад
@@KrisKasprzak Thanks. Is there any 7 inch display with configurable addresses? Can you please drop the link. Thanks
@harshmudgil4140
@harshmudgil4140 5 лет назад
@@KrisKasprzak need this^ very badly
@KrisKasprzak
@KrisKasprzak 5 лет назад
@@harshmudgil4140 I've seen 7" but are for Due and Megas. And since the plug right into the Mega i'm not sure you can have more that one. I seriously doubt an Uno could drive them very well--but even moving to the Mega will have the same challenges--connecting >1 display
@freddyfriedmanyustiz3654
@freddyfriedmanyustiz3654 2 года назад
I managed to get it working but couldn't get to 128 x 64 pixel mode, only 128 x 32 pixel mode, I edited the Adafruit_ssd1306.H library file and did what you told one of the users, leaving the line uncommented #define SSD1306_128_64 and it worked for me but now it only turns on one of the screens and the Arduino constantly restarts, please if you can help me I appreciate it.
@KrisKasprzak
@KrisKasprzak 2 года назад
Try putting a serial.println(“here”) in various places in your code try to see when it crashes. I suspect you’re trying to write or access an array value that is out of bounds.
@freddyfriedmanyustiz3654
@freddyfriedmanyustiz3654 2 года назад
@@KrisKasprzak Hello, thanks for your prompt response, I am using the same code that you published to do the tests, everything works until you edit the library and change the line you indicate, could it be the version of the library? which one are you using?
Далее
Arduino and 128x64 OLED Display FREE CODE!!!
7:28
Просмотров 109 тыс.
OLED Displays with Arduino - I2C & SPI OLEDs
41:41
Просмотров 1,1 млн
ПРОСТИ МЕНЯ, АСХАБ ТАМАЕВ
32:44
Просмотров 2,3 млн
кого отпустят гулять чееек
00:53
My Top 5 Arduino Displays
4:59
Просмотров 221 тыс.
Det baut Zeugs - OLED Displays mit u8g2
21:29
Просмотров 6 тыс.
Display examples - which one to use?
12:41
Просмотров 255 тыс.
Can the ESP32 Handle 6 animated GIFs on 6 Screens ?
6:36
Electromagnetic Aircraft Launcher
15:09
Просмотров 966 тыс.
Hacking a weird TV censoring device
20:59
Просмотров 3,1 млн