Using Multiple Displays with Arduino FREE CODE

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • This video shows how to use multiple OLED displays with a single Arduino UNO.
    Free sketches here at:
    Follow the link and click the large green button that says Code and select the Download ZIP file
    github.com/KrisKasprzak/DualD...
  • กีฬา

ความคิดเห็น • 109

  • @TactlessWookie
    @TactlessWookie 7 ปีที่แล้ว +3

    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...

  • @Taran72
    @Taran72 5 ปีที่แล้ว +4

    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. :)

  • @DavidRisnik
    @DavidRisnik 2 ปีที่แล้ว

    Thanks for the very detailed explanations Kris !. It was very useful for my project. thanks

  • @Flynn3778
    @Flynn3778 6 ปีที่แล้ว +1

    Worked perfectly! What a great bit of clean code.

    • @KrisKasprzak
      @KrisKasprzak  6 ปีที่แล้ว

      You're very welcome. Glad I could help.

  • @kd_rowdy_boy
    @kd_rowdy_boy 4 ปีที่แล้ว +2

    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

  • @khaledmaliaklanalbanna3586
    @khaledmaliaklanalbanna3586 2 ปีที่แล้ว +1

    It's a great and helpful project. Thank you for your effort.

  • @rallymax2
    @rallymax2 2 ปีที่แล้ว +4

    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.

  • @user-wv4nk3eb4n
    @user-wv4nk3eb4n 5 ปีที่แล้ว +2

    Thank you very much~you save my project!!

  • @jakehealthx
    @jakehealthx 2 ปีที่แล้ว +1

    Extremely interesting and helpful. Thank you!

  • @LuisHernandez-ev5ho
    @LuisHernandez-ev5ho 2 ปีที่แล้ว

    Excellent explanation, clean and simple

  • @kristinwagoner6688
    @kristinwagoner6688 3 ปีที่แล้ว

    Very helpful! Thanks for posting your work here

  • @phmaximus
    @phmaximus 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      the resistor is a 0 ohm, which is basically a blob of solder. I found it impossible to move the tiny resistor.

    • @davidjackowski4336
      @davidjackowski4336 5 ปีที่แล้ว

      My resistor was four hundred something. Im going to pretend it was 0. Hopefully I dont let the magic blue smoke out!

  • @mytechexplanations6923
    @mytechexplanations6923 3 ปีที่แล้ว +1

    Awesome...👍👍

  • @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.

  • @billswan9395
    @billswan9395 4 ปีที่แล้ว +2

    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  4 ปีที่แล้ว

      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

  • @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.

  • @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

  • @logansonft9819
    @logansonft9819 6 ปีที่แล้ว

    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
      th-cam.com/video/QQLfzlPGjjE/w-d-xo.html

  • @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.

  • @tomaszpatelczyk3511
    @tomaszpatelczyk3511 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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?

  • @gpenn9225
    @gpenn9225 3 ปีที่แล้ว

    can i use this for 2 display 3,5 inches?

  • @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.

  • @StarStudios007
    @StarStudios007 5 ปีที่แล้ว +2

    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.

  • @TGameMaster1993
    @TGameMaster1993 6 ปีที่แล้ว +4

    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 5 ปีที่แล้ว

      Just noticed that too

    • @MEan0207
      @MEan0207 5 ปีที่แล้ว

      Absolutely

    • @kawawangkowboy9566
      @kawawangkowboy9566 3 ปีที่แล้ว

      You can also skip the intermediate conversion and just say
      const uint8_t address = 0x7a >> 1;

    • @jakehealthx
      @jakehealthx 2 ปีที่แล้ว

      Yes I saw that too.

  • @mac1mike
    @mac1mike ปีที่แล้ว +1

    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.

  • @harryohanson
    @harryohanson 2 ปีที่แล้ว

    Can you double the amount of displays signing a different output from Arduino for the other pair?

    • @KrisKasprzak
      @KrisKasprzak  2 ปีที่แล้ว

      These are I2C based, so if your MCU has a second bus, maybe?!?

  • @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

  • @AlexTango
    @AlexTango 7 ปีที่แล้ว

    awesome dear, need new video, go forward - super!

  • @joniboy0782
    @joniboy0782 9 หลายเดือนก่อน

    What is the maximum amount of screens that you can connect with an arduino? Would 6 be alright?

    • @KrisKasprzak
      @KrisKasprzak  9 หลายเดือนก่อน

      It depends on how many different addressable displays you can find. I've only been able to find 2.

  • @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

  • @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

  • @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 ปีที่แล้ว +1

      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 ปีที่แล้ว +2

      I've never used those, but I'm guessing they will work. Thanks for sharing!

  • @CrazyCoupleDIY
    @CrazyCoupleDIY 6 ปีที่แล้ว +2

    Is there a way to connect more than 2 displays

    • @KrisKasprzak
      @KrisKasprzak  6 ปีที่แล้ว +2

      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 ปีที่แล้ว +2

      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 5 ปีที่แล้ว +1

      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 5 ปีที่แล้ว

      Please, can you give me an aproach of what you did? Did you use the multiplexer?

    • @CrazyCoupleDIY
      @CrazyCoupleDIY 5 ปีที่แล้ว +2

      Check this out: th-cam.com/video/_e_0HJY0uIo/w-d-xo.html

  • @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 ปีที่แล้ว +1

      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 4 หลายเดือนก่อน

      ​@KrisKasprzak hi I'm checking back with you, any fresh updates?

  • @uwesmodellbau8295
    @uwesmodellbau8295 2 ปีที่แล้ว

    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!

  • @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?

  • @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) : th-cam.com/video/eI3fxTH6f6I/w-d-xo.htmlm29s

  • @fabricio.ferrari
    @fabricio.ferrari 4 ปีที่แล้ว +1

    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. 👍🏽

  • @mav29
    @mav29 4 ปีที่แล้ว +1

    thx thx thx

  • @juliocoq777
    @juliocoq777 3 ปีที่แล้ว

    👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍

  • @Thecrazytv3
    @Thecrazytv3 8 หลายเดือนก่อน

    I want add 4 display how change address

    • @KrisKasprzak
      @KrisKasprzak  8 หลายเดือนก่อน

      All the displays I’ve seen have a fixed address with only two settings.

  • @harshmudgil4140
    @harshmudgil4140 5 ปีที่แล้ว

    I want to use 2 displays as 1.

    • @KrisKasprzak
      @KrisKasprzak  5 ปีที่แล้ว +1

      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

  • @TCBEperformance
    @TCBEperformance 7 ปีที่แล้ว

    I thought 0X78 is a 7bit number!

  • @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?