Arduino OLED Animations -- tutorial for beginners, Arduino UNO, u8g2, Adafruit GFX, SSD1306, SSD1309

  Переглядів 128,982

upir

upir

8 місяців тому

Do you like video? Please consider buying me coffee, thanks! www.buymeacoffee.com/upir
PCBWay - www.pcbway.com/setinvite.aspx...
WOKWI project - wokwi.com/projects/3742941662...
SOURCE files: github.com/upiir/arduino_oled...
------------------------------------------------------------------------------------------
In this project, I will show you how to show a simple animation using Arduino UNO and OLED display (SSD1306 IIC OLED). The graphics library for drawing images is u8g2 and Adafruit GFX. Enjoy!
------------------------------------------------------------------------------------------
Links from the video:
WOKWI animator: animator.wokwi.com/
Animated icons: icons8.com/icons/set/popular-...
128x64 SSD1306 OLED Display 1.54": s.click.aliexpress.com/e/_DCY...
128x64 SSD1306 OLED Display 0.96": s.click.aliexpress.com/e/_DCK...
128x64 SSD1306 OLED Display 2.42": s.click.aliexpress.com/e/_DFd...
Arduino UNO: s.click.aliexpress.com/e/_AXDw1h
Arduino breadboard prototyping shield: s.click.aliexpress.com/e/_ApbCwx
Image2cpp (convert image to c-style array): javl.github.io/image2cpp/
Photopea (online graphics editor like Photoshop): www.photopea.com/
Piskel Application: www.piskelapp.com/p/create/sp...
Related videos with Arduino UNO and 128x64 OLED screen:
Arduino OLED menu: • Arduino OLED Menu Tuto...
U8g vs U8g2: • U8g vs. U8g2 Arduino G...
Arduino Parking Sensor - • DIY Parking Sensor wit...
Turbo pressure gauge with Arduino and OLED display - • Turbo pressure gauge w...
Arduino Car Cluster with OLED Display - • Arduino Car Cluster wi...
Knob over OLED Display - • Knob over OLED Display...
Arduino + OLED = 3D ? - • Arduino + OLED = 3D ?
Arduino OLED Gauge - • Arduino OLED Gauge
Smaller & Faster Arduino - • Smaller & Faster Arduino?
------------------------------------------------------------------------------------------
PCBWay is a service for manufacturing custom PCBs. If you click the link above, you will get a coupon for $5, which is exactly the price of 10 pieces of custom PCBs. In that case, you will only pay for shipping. Do you have any experience doing this? Please let me know in the comment section!
------------------------------------------------------------------------------------------------------------------------------
Do you have any questions? Suggestions for the next video? Please put those down in the comment section. I try to answer as many questions as I can. Thank you for watching, reading the video description and I hope to see you next time. Good luck with your projects!
--------------------------------------------------------------------------------------------------------
#arduino #oled #animation
--------------------------------------------------------------------------------------------------------

КОМЕНТАРІ: 142
@upir_upir
@upir_upir 3 місяці тому
Do you like this video? Please consider buying me a coffee, thank you! www.buymeacoffee.com/upir
@Wokwi
@Wokwi 8 місяців тому
Finally someone found out about the Wokwi Animator 😉
@upir_upir
@upir_upir 7 місяців тому
It’s a great tool, thank you for creating it! Do you have any idea why the second animation was not generating any data?
@Wokwi
@Wokwi 7 місяців тому
@@upir_upirIt was a bug in the app. Most animations have a transparent background, and were correctly converted to 1-bit bitmap for the SSD1306. This specific animation had a white background, which caused the issue. It should be fixed now!
@upir_upir
@upir_upir 7 місяців тому
@Wokwi ok, thank you for fixing it!
@smug_cat1
@smug_cat1 3 місяці тому
Now pay him
@christianmcdowell3052
@christianmcdowell3052 8 місяців тому
Your content has been so fundamental to my projects and learning. Truly a wonderful age to live in technologically, but your personal effort is what really makes this happen. Thank you.
@upir_upir
@upir_upir 8 місяців тому
Thank you for your nice words, I really appreciate it! Good luck with your projects and stay tuned for more content.
@randalltockes2247
@randalltockes2247 4 місяці тому
This helped so much. Been wanting to play around with a bitmap animation for a long time. Finally got one working.
@upir_upir
@upir_upir 4 місяці тому
That´s great to hear, I´m glad it was helpful. Good luck with your project!
@YourMomGay258
@YourMomGay258 8 місяців тому
Máš prostě nejlepší arduino kanál na celým yt.. fakt nejzajímavější věci, žádný přiblbaný meteostanice jako každej.. díky za to!
@upir_upir
@upir_upir 8 місяців тому
Dobře, píšu si, žádné meteostanice :) Každopádně nevím jestli je kanál nejlepší, to určitě ne, ale díky za pěkný komentář.
@jankomuzykant1844
@jankomuzykant1844 8 місяців тому
Difference between those addresses is that 0x3c/0x3d is 7-bit addr for lcd as in i2c spec and 0x78/0x7a is 8-bit data which must be sent thru bus with LSB set for i2c direction (read/write).
@upir_upir
@upir_upir 8 місяців тому
Thank you for the clarification. It would still make more sense to list 7-bit addresses on the PCB as those are the addresses that you set in the code.
@user-yq5tx9lf6z
@user-yq5tx9lf6z 8 місяців тому
Super helpful!!! Nice vid 😆
@upir_upir
@upir_upir 8 місяців тому
Thank you, I’m glad it was helpful!
@bimokayoba
@bimokayoba 8 місяців тому
Thanks upir ♥, you always came up with new tools that most of us didnt know ☺, Thanks a lot ♥♥
@upir_upir
@upir_upir 8 місяців тому
You are welcome, thank you for your comment!
@andymouse
@andymouse 8 місяців тому
The walking animation looked great !....cheers.
@upir_upir
@upir_upir 8 місяців тому
Thank you, I can always count on you! :)
@mohamedgendia4274
@mohamedgendia4274 7 місяців тому
Thanx alot ur video saved me a tons of times coding the byte array ❤
@upir_upir
@upir_upir 7 місяців тому
Glad to hear that. Thank you for your nice comment and good luck with your projects!
@upir_upir
@upir_upir 8 місяців тому
Have you ever created any animations for OLED display? I would love to see them!
@pje_
@pje_ 8 місяців тому
A calculator popping out from the left
@Naku93
@Naku93 5 місяців тому
I made the animation of a RGB LED ladder that displays the same visual effect pattern of the led strip before displaying on it.
@martinkuliza
@martinkuliza 3 місяці тому
I've created animations for CRO's in X-Y Mode does that count
@upir_upir
@upir_upir 3 місяці тому
What is CRO?
@Destiny4CODERS
@Destiny4CODERS 3 місяці тому
@@upir_upir CRO = Cathode Ray Oscilloscope
@GnobarEl
@GnobarEl 4 місяці тому
I learn a lot from your videos! In 13 I got plenty of information! Thanks for sharing!
@upir_upir
@upir_upir 4 місяці тому
Thank you, I´m trying to squeeze as much information as possible, I know nobody has time :)
@GnobarEl
@GnobarEl 4 місяці тому
@@upir_upir Thats why I like your videos! straight to the point! No wasting time about things no one cares! Keep your great work! Can't wait to see the next one :)
@upir_upir
@upir_upir 4 місяці тому
@GnobarEl thank you! Please feel free to check my other videos as well.
@soniccinos
@soniccinos 4 місяці тому
That's some high level content!!!!!! Congrats for the video!! I'm using the ESP8266 but the steps are almost the same!!!
@upir_upir
@upir_upir 4 місяці тому
That’s great to hear! Thank you for your comment.
@imranics1142
@imranics1142 8 місяців тому
Good work 👍
@upir_upir
@upir_upir 8 місяців тому
Thank you, I´m glad you like it!
@aaronsaldanha2815
@aaronsaldanha2815 8 місяців тому
Thanks a lot!
@upir_upir
@upir_upir 8 місяців тому
You are welcome! Good luck with your projects
@trobinso92
@trobinso92 7 місяців тому
Thanks!
@upir_upir
@upir_upir 7 місяців тому
Thanks a lot sir, I really appreciate that!
@buildyear86
@buildyear86 7 місяців тому
incredible skills. Really amazed. Could all of this also work the same using small sized graphical monochrome lcd displays?
@upir_upir
@upir_upir 7 місяців тому
Yes, that should be possible. Google "u8g2 gallery" and you will find a lot of different displays for which you can use this technique.
@buildyear86
@buildyear86 7 місяців тому
@@upir_upir thank you for this suggestion. I am pretty new to this and surely will learn more from your channel... ofc subscribed!
@MrXRes
@MrXRes 8 місяців тому
I advice to store difference between frames instead of whole frames Also you can try to use RLE compression
@upir_upir
@upir_upir 8 місяців тому
Do you have any example of using the RLE compression with Arduino uno and this oled display? It would surely be worth trying, but I’m worried about the performance.
@nrdesign1991
@nrdesign1991 8 місяців тому
I'm really surprised it works this fast over I²C, the examples I've seen so far are all a lot slower.
@upir_upir
@upir_upir 8 місяців тому
Perhaps it´s because I´m only drawing pictures sized 50x50px? Drawing a fullscreen picture would be surely slightly slower.
@tanjiro3285
@tanjiro3285 8 місяців тому
Please make a video of Esp32 with OLED displays as it can be used with much more diverse applications. (With u8g Library
@upir_upir
@upir_upir 8 місяців тому
That´s exactly my plan!
@tanjiro3285
@tanjiro3285 8 місяців тому
@@upir_upir 🔥🔥🔥
@justinc2633
@justinc2633 5 місяців тому
esp32 is exactly the same, did you even try it?
@tanjiro3285
@tanjiro3285 5 місяців тому
@@justinc2633 yup bro. I was able to get it working. I was just suggesting him to implement WiFi and Bluetooth with oled to make them even more interesting 🙂
@LastChanceNow
@LastChanceNow 8 місяців тому
Your projects are always interesting. Thank you. I saw simplification here. The black ball will pass through the coordinates of this icon. Sorry for being smart.)
@upir_upir
@upir_upir 8 місяців тому
Thank you for your nice comment, but I’m not quite sure if I understand the second part.. which ball? What coordinates?
@LastChanceNow
@LastChanceNow 8 місяців тому
figure eight coordinates. those. the ball runs along the track like a sports car and paints the icon itself black on a black background. Sorry for the english.
@imtrung5244
@imtrung5244 3 місяці тому
I have login to say thanks for simulator and lopaka. It save me a lot of time for working with display modules
@upir_upir
@upir_upir 3 місяці тому
Thank you for your nice comment, but of course big thanks goes to the creators of those great tools. Good luck with your projects!
@Wawan_Setiaw4n_Robotik
@Wawan_Setiaw4n_Robotik 5 місяців тому
Terimaksih informasinya, sukses selalu semoga ilmunya berkah.
@upir_upir
@upir_upir 4 місяці тому
What?
@Wawan_Setiaw4n_Robotik
@Wawan_Setiaw4n_Robotik 4 місяці тому
@@upir_upir Thank you for the information, always success, hopefully the knowledge will be a blessing..
@Keeping_IT_Simple
@Keeping_IT_Simple 8 місяців тому
really interested as to why the animation plays slower on the R4 even though it has a faster processor I have seen this on a couple of other boards that have higher clock speed than UNO maybe it has something to do with the Arduino IDE board package for the device?
@upir_upir
@upir_upir 8 місяців тому
Not quite sure what is the reason, but it was slower also when using the Adafruit library. I need to investigate it little bit more, as I would like to switch to R4 because I enjoy the bigger memory.
@Keeping_IT_Simple
@Keeping_IT_Simple 8 місяців тому
@@upir_upir I have also seen slower animation on RP2040 based board as well as NFR5280 based devices .
@sanjyuu2298
@sanjyuu2298 2 місяці тому
It's listed as 0x78, because it is what you send for real to address this screen, depends how you use it, it is either {0x3C
@upir_upir
@upir_upir 2 місяці тому
Thank you for your comment and for the clarification. Is the IIC address generaly listed as 7bit or 8bit? Is there a way by looking at the address to know if it´s 7bit or 8bit?
@sanjyuu2298
@sanjyuu2298 2 місяці тому
@@upir_upir I can't say for sure, but it is propably up to device/manufacturer. If you would want to move r/w bit to another byte, then you could have 8-bit address, but you would always need to send at least 2 bytes in order to tell a device if you want to read or write. I had only "experience" with two I2C devices, LM75A temperature sensor and this SSD1306. LM75A had same addressing mode. One of the methods to check if unknown device have 7 or 8-bit address, is to use I2C scanner and look how many device you'll find, with 7-bit devices, you'll always find two of them (for e.g. 0x78 and 0x79). Internet says that I2C device is always 7-bit address followed by read/write bit, but there is nothing to stop you from using 8-bit address if you'd build your own I2C device. It is sometimes valuable to know how I2C address byte is made because while hardware I2C may operate on 7-bit values and you may never know what is really sent, it might be an onset of really hard (bat maybe really short) brainstorm when you have to make a software implementation of I2C from the grounds. :)
@theprofessional2676
@theprofessional2676 8 місяців тому
Please make a video for using Xbee with Oled display and the parking sensors! I am making a rc project and your code is 90% of the project and I learned soooo much from your videos!
@upir_upir
@upir_upir 8 місяців тому
Thank you for your comment. Have you seen the parking sensor video? Perhaps that might be a good starting point?
@vinyltheif
@vinyltheif 4 місяці тому
Hi. A good explanation there. Do the patterns also work with the 32x64 oled?
@upir_upir
@upir_upir 4 місяці тому
Yes, they do. Just make sure the animation size can fit the display, but if you are talking about the SSD1306 display, it should work without any problems.
@arduinomaquinas
@arduinomaquinas 3 місяці тому
Awesome, very cool brother 😉👏👏👏
@upir_upir
@upir_upir 3 місяці тому
Thank you, I´m glad you like it!
@krishnabhandari5583
@krishnabhandari5583 8 місяців тому
I am learning alot from your content and i request you to make a video on displaying of our picture animation or picture with happy birthday display and song.
@upir_upir
@upir_upir 8 місяців тому
Thank you for your comment, can you just use this video as a start and choose a different animation? As for the song, this might be a good start - projecthub.arduino.cc/Sparkbuzzer/happy-birthday-tone-using-arduino-uno-66a676
@scalt8367
@scalt8367 8 місяців тому
Hi Upir, is it possible to add multiple animation in one code if so can you make a video out of it please !
@SyncMotion27
@SyncMotion27 8 місяців тому
Yes, it is possible. You can have multiple animations by programming to switch to the next animation automaticaly or by pressing a button.
@upir_upir
@upir_upir 8 місяців тому
Someone was quicker with the reply, but yes, it is possible. You can have as many animations as you want as long as it fits into the available memory.
@scalt8367
@scalt8367 8 місяців тому
@@SyncMotion27 thanks ! I will try that.
@scalt8367
@scalt8367 8 місяців тому
@@upir_upir Thanks !
@upir_upir
@upir_upir 8 місяців тому
You are welcome. Please feel free to check also my order videos as I have quite a lot of them using the same display and showing animations.
@eerrfanshayyestehh2069
@eerrfanshayyestehh2069 8 місяців тому
🙋‍♂️👍👍good my friend
@upir_upir
@upir_upir 8 місяців тому
Thank you!
@user-yb4ix3eq6r
@user-yb4ix3eq6r 2 місяці тому
thanks 🌹
@upir_upir
@upir_upir 2 місяці тому
You're welcome 😊
@calvin2013
@calvin2013 29 днів тому
What about displaying animations alongside custom text or even more complicated; alongside variable values being updated in real time as well?
@upir_upir
@upir_upir 28 днів тому
Yes, I have both scenarios covered in my other tutorials, please feel free to check my playlist with OLED displays.
@juancarlos1549
@juancarlos1549 8 місяців тому
I really liked your video today @upir ... And it's just where I have a problem with an Array of 1000 samples, but I'm doing a 560 Hz sine signal through a matrix without the screen that you use, just I am using a R2R Network with an amplifier... If you make the same signal with 256 samples you can see the output signal, but increasing to 1000 samples the signal is distorted... By the way, I am using interrupts to increase the frequency... According to your experience, what could be the problem you have when you increase the number of samples of a matrix from 256 to 1000???? Greetings.
@jankomuzykant1844
@jankomuzykant1844 8 місяців тому
What is the type of the variable for sample counter ? Maybe it's byte (char) 🤔
@juancarlos1549
@juancarlos1549 8 місяців тому
@@jankomuzykant1844, At first I used byte, but then I changed it to char and in neither of the two modes it works, the output signal is distorted... I have come to the conclusion that the array has many elements (1000 samples)... Greetings.
@jankomuzykant1844
@jankomuzykant1844 8 місяців тому
@@juancarlos1549 Then you need integer because 1000 samples is 10-bit counter and char is only 8 bit
@juancarlos1549
@juancarlos1549 8 місяців тому
@@jankomuzykant1844...I am going to tell you what I did, first I know that the R2R that I was going to use needs a number of 2^8 = 256, this is because of the Arduino ports, so my sinusoidal signal cannot exceed those values, the smaller number is 0 and the largest is 255... I did all this in MATLAB as with 256 samples the sinusoidal signal comes out very distorted in MATLAB and in the Arduino output, I put 1000 in MATLAB and a perfect sinusoidal signal comes out with 1000 samples, but the Arduino only outputs a very distorted signal, but not the signal I want... Now do you understand the problem? Greetings.
@upir_upir
@upir_upir 8 місяців тому
Looks like someone was quicker with the answer, hopefully that did solved your problem. Yes, both byte and char are 1 byte variables, and could only hold 256 values - either -128...+128 or 0..256
@slabua
@slabua 8 місяців тому
Is there any equivalently easy way to do it for micropython/pico, that you are aware of?
@upir_upir
@upir_upir 8 місяців тому
I have used micropython with pico in my older video, and was able to display image in a very similar way, so I believe that you can use this approach and just slightly modify it to run on pico. I will try it and let you know how it went..
@slabua
@slabua 8 місяців тому
@@upir_upir Thank you!
@kaylajason8917
@kaylajason8917 2 місяці тому
Thank you so much, worked great. But now have idea for valentines gift. But with flaticon the animation has 2 colors and when i did this its not bringing over the teal color. Is there a trick or way to bring jpg over in one color
@upir_upir
@upir_upir 2 місяці тому
You are welcome, try playing with the threshold slider and hopefully that will help.
@asirisudarshana536
@asirisudarshana536 8 місяців тому
Can we use with nodemcu 8266
@upir_upir
@upir_upir 8 місяців тому
Yes, that´s possible. I don´t think you even have to modify the code.
@sammessina3849
@sammessina3849 3 місяці тому
Did you have any issues with the OLED flickering while on camera? If so how did you address it? Thanks :D
@upir_upir
@upir_upir 3 місяці тому
I do, all the time. You need to set the camera settings correctly, and even then, I still see the flickering from time to time. Thankfully it´s only on camera, not visible in real world.
@bobbygummy5114
@bobbygummy5114 27 днів тому
Hi, I'm using a 2.42 Oled Display SSD1309 SPI with 7pins .... I was wondering how to make the animation code from Wokwi work for my oled display
@upir_upir
@upir_upir 25 днів тому
Please see my older videos where I was also using SPI displays, which should give you some clues about the connections. Otherwise, code-wise, it´s not a big difference.
@bobbygummy5114
@bobbygummy5114 25 днів тому
​@@upir_upirthank you so much😄🥰
@Roreal4976
@Roreal4976 2 місяці тому
🙏🙏🙏
@upir_upir
@upir_upir 2 місяці тому
You are welcome!
@salmanchaudry7459
@salmanchaudry7459 6 місяців тому
What if i need to use this with SH1106 driver based OLED's?
@upir_upir
@upir_upir 6 місяців тому
For u8g2 library, you just use a different initialization. For example: U8G2_SH1106_128X64_NONAME_F_HW_I2C(rotation, [reset [, clock, data]]) [full framebuffer, size = 1024 bytes]
@fullpower8382
@fullpower8382 8 місяців тому
Du bisch brudal! :o)
@upir_upir
@upir_upir 8 місяців тому
What is "brudal"?
@fullpower8382
@fullpower8382 8 місяців тому
@@upir_upir Hi my Friend. Its a German dialected Word (In Germany called "schwäbisch") what u can use for great, fantastic or any other positive Description. :-) A german Reader would still understand.
@electrochem8819
@electrochem8819 4 місяці тому
im kinda new at this. this works with 0.96in oled but my 1.54in oled didn't, is there something I can do here?
@upir_upir
@upir_upir 4 місяці тому
Sometimes, the display uses SH1106 chip instead of SSD1305, try changing the initialization accordingly to see if that works. You can also include pull-up resistors on the i2C line. Finally, the SSD1306 chip can have two different addresses, perhaps you need to see the address first. Run the I2C scanner sketch first to find out the address. Hope this helps!
@danielli6665
@danielli6665 Місяць тому
My SSD1309 has 7 pins, does it work with this? If so, what's the connections?
@upir_upir
@upir_upir Місяць тому
It will work, your is SPI version. Just use a different initialization. I believe I have the connections listed in my "arduino turbo gauge" video.
@user-mg6xe9tm1t
@user-mg6xe9tm1t 13 днів тому
🎉Наверно все супер. Но не чего не понятно. Но видно что человек со знанием дела
@upir_upir
@upir_upir 13 днів тому
English please? Thanks!
@grea2sy3gaming49
@grea2sy3gaming49 Місяць тому
I tryed everything but every time a get this snow crash screne can someone help me out please?
@upir_upir
@upir_upir Місяць тому
Can you provide more details? Does it show an image and than it stops animating? Do you see any content at all?
@karlohorcicka7388
@karlohorcicka7388 8 місяців тому
Bro... The way things are going, in a few videos you'll make arduino gameboy 🤣
@upir_upir
@upir_upir 8 місяців тому
Don´t say it twice :)
@developedmobile4692
@developedmobile4692 Місяць тому
It Work with esp 8266 ?
@upir_upir
@upir_upir Місяць тому
Yes, it should work with ESP as well. If your is ESP32, you can also simulate it on WOKWI.
@developedmobile4692
@developedmobile4692 Місяць тому
@@upir_upir ok bro
@ekhalilov5543
@ekhalilov5543 8 місяців тому
@upir_upir
@upir_upir 8 місяців тому
:)
@broteendas1194
@broteendas1194 13 днів тому
How many more open source resources does this guy know about?
@upir_upir
@upir_upir 13 днів тому
I´m sure there are many tools that I don´t know about yet!
@karlohorcicka7388
@karlohorcicka7388 8 місяців тому
I have no sound on your video
@upir_upir
@upir_upir 8 місяців тому
I´m sorry to hear that but that´s most likely a youtube issue.
@justinc2633
@justinc2633 5 місяців тому
if you need more memory the solution is most definitely not another arduino lol. get an esp32
@upir_upir
@upir_upir 5 місяців тому
Agreed. But there are some Arduino clones that have plenty of memory.
@patamax7879
@patamax7879 3 місяці тому
On ferait ça en 1985 avec un Thomson to5 😅😅😅.
@upir_upir
@upir_upir 3 місяці тому
Do you mean mo5? 😳
@mrbeatsgiveaway5133
@mrbeatsgiveaway5133 8 місяців тому
whyd
@upir_upir
@upir_upir 8 місяців тому
What?
@raqtty
@raqtty 8 місяців тому
i was looking for something like img2cpp, ty
@upir_upir
@upir_upir 8 місяців тому
I’m glad it was helpful. Feel free to check also my other videos, as there are a few more useful tools like Lopaka.
Машины в 2018 и в 2024
00:15
Gazan
Переглядів 896 тис.
SimHub gear indicator
24:38
upir
Переглядів 6 тис.
DDS VFO Afficheur oled 2,42 po
0:43
ve2ydq
Переглядів 2,5 тис.
Posy’s designs ➔ REAL DISPLAYS
8:50
upir
Переглядів 343 тис.
How to use SSD1306 128x64 OLED Display I2C with Arduino code
22:36
Animated eyes on arduino and oled display
0:18
intellar
Переглядів 8 тис.
Pimp My Encoder!
22:49
upir
Переглядів 14 тис.
OLED Displays with Arduino - I2C & SPI OLEDs
41:41
DroneBot Workshop
Переглядів 1 млн
Should I use THIS display?
27:07
upir
Переглядів 147 тис.