How to create a custom animation for 128x32 OLED SSD1306 Display with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 พ.ค. 2024
  • Last week I posted a tutorial showing how to connect and use 128x32 SPI OLED display with Arduino.
    This is the follow up video showing the process of creating the custom animation for that display.
    Hope you will enjoy this content.
    Here is the link to the code:
    create.arduino.cc/projecthub/...
    If you like this content and you want to support me in creating similar videos go to my Patreon webpage
    / mariosideas
    Or
    www.paypal.com/cgi-bin/webscr...
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    That was an excellent result. I will certainly try that! Also I agree with others below that your intro was really good! Keep up the good work. I am keen to try more stuff using these OLED displays. I am going to dry driving more than one display from the same Arduino by using a multiplexer on the SCL line.

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

      Cool that people like the intro. in my channel you will find a film here I make it. It was a lot of fun

  • @justnino174
    @justnino174 4 ปีที่แล้ว

    Wow you are really putting effort into these videos, well done!

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      Thanks man:) Please check my other video about making stop motion animation of my channel intro. I will be doing more animation videos with mixing various techniques.

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

    Love that website you showed, thank you!

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

    Can you please send a link to the Produkts? Mentioned in the Video! I can't find them

  • @Steve-wx1gk
    @Steve-wx1gk ปีที่แล้ว

    Thanks Man you explained it perfectly

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

      Thanks.Like the video if you enjoyed it:)

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

    The best intro ever!

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

    BEST INTRO EVAA

  • @DIYUSTHAD
    @DIYUSTHAD 4 ปีที่แล้ว

    Great, Keep uploading

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      Thanks. Don't forget to subscribe to my channel

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      Just did:)

  • @BlueeBubble
    @BlueeBubble 4 ปีที่แล้ว

    Hi! Can you please explain that last line regarding looping the image? I want an animation to loop infinitly but can't do it :( thanks!

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      In arduino the code is executed in the function called loop and it always loops infinitly. You do not have to program it. When loop function in which I program a single sycle of movement , finishes, it immediately starts again

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      And as far as the last line is concerned you start with the variable frame delay equals to 420ms. you run the whole cycle and in the last line the you set frame_delay=frame_delay-50 so in the next loop run the frame delay is 370 and so on and so on. You substract 50 from frame delay only when it is larger then 100. So when we get down to 70 (420-7*50) we do not decrease frame_delay anymore and we reach our target one (70)

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

      @@marios_ideas why don't we just set it to 70 straight away? does it cause any issues?

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

      I wanted to see the animation frame by frame in slow motion and then excelerate it until the movement becomes smooth. If you want to just see the animation you can set it to 70

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

      @@marios_ideas Got it! Thanks for the quick reply! :)

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

    Hello! First of all, thanks for the tutorial I have a simple question that I can't solve by myself. I can get the screen to show the animation and it's working fine, but don't know why, the image is stretching, so it's taller that I should (and it goes out from the screen in the down part), and it's less width that it should. Any idea about why this might be happening?

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

      Not sure. The onlythink I can think of is that you are using 128x64 oled display and you are using my code that decalres 128x32 dimentions.

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

    hey can someone help me. i want to reduce program storage, so i want my code to be more short. so i use for loop to iterate each frame to display. but result is my bitmap crash.

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

      but work properly when i draw without iterate it.

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

      Send me your code. When I have some time I will have a look at it. that is if you have not solved it yet

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

      @@marios_ideas i will send you the code. Thank you for help

  • @NoraMadigan
    @NoraMadigan ปีที่แล้ว

    my display has 4 pins how can I adapt the code?

    • @marios_ideas
      @marios_ideas  ปีที่แล้ว

      I have a number of videos with 4 pin oled display . E.g building a timer, analog style clock o my letest about Rfid. Check just the setup part of the code and the oled display needs to be connected to a4 and a5. It will be very similar

  • @tatageek
    @tatageek 4 ปีที่แล้ว

    good video !

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

      Glad you liked it. Please check my channel for similar content. I will be loading a video about 8x8 LED matrixes that you may find interesting latest tomorrow

    • @marios_ideas
      @marios_ideas  4 ปีที่แล้ว

      Just added a promised video. Please check it out and let me know what you think:)

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

    If I wanted to make it run 2x faster, how would I do that?

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

      The speed is controlled by frame_delay variable
      So now in code you have
      At the start
      int frame_delay =420;
      Then we gradually decrease frame delay until it reaches 70 and then it does not change anymore.
      if (frame_delay>100) frame_delay=frame_delay-50;
      You have to remove the line
      if (frame_delay>100) frame_delay=frame_delay-50;
      And change the other one to :
      int frame_delay =35;

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

      I will be doing one or two more animation videos so if you want to check them out subscribe and set tonifications. It should be published within next 3 weeks. I am waiting the EPROM component to arrive to be able to film it

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

      @@marios_ideas yeah your video was definitely very helpful and I got some animations to run after testing a whole bunch, but I just can't figure out how to actually speed it up rather than not slow it down if that makes sense. I've tried doing what you said and even putting frame_delay to 0, but is there a way to make it faster? I'll be watching out for your new vids 👀 keep it up :D
      edit: the only solution I came up with was taking out some frames/pictures.

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

      Harry C Check my response above

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

      @Mario's Ideas yes but didn’t you include frame_delay just to slow it down? Removing/lowering it just puts the animation at ‘normal speed’ with little to no delay, doesn’t it? Or am I missing something? What I want is to speed it up when the delay is minimal/non-existent, not just lower the delay so it’s ‘normal speed’. For example, if I had 60 bitmaps/images I want to be able to speed through them at more than double normal speed while there’s no delay function in the first place. Is that possible?

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

    Amazing example!!! You know that it's possible to do the same thing with an TFT 160x80 IPS ST7735 display? I'm going completely crazy trying to find information about how to do it XD

    • @marios_ideas
      @marios_ideas  3 ปีที่แล้ว +2

      Unfortunately it is not as straight forward. OLED display has only 128x32 pixels so we can fit our frames into the SRAM. With ST7735 color interface this gets more complicated you. You will run out of space not to mention that this is a color display so you would need even more memory to remember the frame. So solution would be to have fram bitmaps saved on the SD card and replay them one by one. Did not play with those displays. Bought one and I have plans to look at it. But I think also the speed (frames per minute) would be a problem here as I am not sure your standard arduino can display frames fast enough. There are more paowerful arduino compatible boards like Bluepill but again have no experience using then. Maybe somebody can chip in to thie conversation and provide some answers

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

      @@marios_ideas Thank you so much for your answer! So in theory, any SSD1306 SPI could animate with your schematic, for example this simple logo? speculativeidentities.com/public/assets/research/off-world/_postFull/Off-World-Overview.png If so, I would buy a 0.96 "SSD1306. I'm using the one I mentioned earlier because the logo OFF WORLD is yellow, and all OLEDs I've seen are either blue or white.

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

      @@CINEMATOGRAPHYFILMART Yes. If you watch one of my videos for creating the Eggtimer there you would find another animation (ringing bell)

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

      @@marios_ideas Awesome!!! I will trie this example with this display. Thank you very much for yout help!!!!

  • @boopeshkumarprabhakaran
    @boopeshkumarprabhakaran ปีที่แล้ว

    I can't find the code

    • @marios_ideas
      @marios_ideas  ปีที่แล้ว

      I will fix it soon. It is the fault of the website i store the code on. They modernised it and it invalidated some of the links

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

    that intro tho... made me laugh but my coworker thought i was watching something nsfw lol

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

    damn it! i used all of position there, but it still messed up ... (

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

      What do you mean by "i used all of position"

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

      @@marios_ideas I talking about values of selections on site for converting BMP to HEX. But all my experiments have no results. Picture on OLED is mashed

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

      @@jackmini1217 Check everthing. If the bitmap you are trying to display does not exceed display size. If this happens you do get total mess. Display something simple first to prove theres is nothing wrong with your display

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

      ​@@marios_ideas Yeah, that exactely i was trying to do first. I draw very simple picture (90x32) in Paint, smaller than display dimensions. My best results is something looks alike my drawing (simple stickman) but anyway some of his parts has been messed. I checked some another application to convert, but results definitely failed...

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

      Use my code to see if it works for you create.arduino.cc/projecthub/Dziubym/oled-animation-5cf5f5?ref=user&ref_id=1474727&offset=4

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

    haha wtf with the intro

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

      haha great or haha not great?:)

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

      @@marios_ideas haha its make me laugh tough,, great,, btw thx for teaching me on animation

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

    Dropping the video resolution each time you explain a block of code is REALLY ANNOYING!

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

      Yes . I know . This is an old one where I was still searching for the best way to show code explanation. If you check my latest videos you will see what I mean. E.g Timer/eggtimer video. This Also shows oled animation