Display animation on OLED using arduino i2c

A photo posted by Mohesh Mohan (@moheshmohan) on

Hey folks,

So i got this new cheap oled display that i wanted for a long time and its time for us to play with it. So you can find lot of tutorials on the web on how to drive the display but lets just move a step farther, lets do some animation with it.

OLED 0.96" 128X64 from aliexpress
what i have is an OLED 0.96" 128X64 I2C (or IIC) interface, with SSD1306 driver, 3.3/5V compatible.

There are 4 pin on the OLED module, GND, VCC, SCL and SDA. Typically to use I2C on an arduino uno you need to connect it something like this


GND - GND on Arduino Uno
VCC - 5V on Arduino Uno
SCL - A5 on Arduino Uno
SDA - A4 on Arduino Uno

Lets have a look at the fritzing view of the connections

Now how do we drive this thing? Don't worry there is an awesome library for led/lcd displays its called u8glib and you can get it here https://github.com/olikraus/u8glib

Now based on this i have created a simple program to display an animation. You can get the source code here https://github.com/moheshmohan/arduino_oled_animation

Basically what i have done is just take 3 bitmap images and play it in a sequence to show the animation. If you look at the source code you can see the arrays in which image information is stored. Now its very easy to convert a bitmap into an array of hex values. you just need the picture editor called gimp http://www.gimp.org/

Open the desired image in gimp and save it as ".xbm" format and just open the xbm file in a text editor, you can get the hex values array for the image. Pretty simple :P

Mohesh loves robots :D
You can watch all of this in my video here




Here is the source code for those who don't wanna go to github

Comments

  1. Great Article Cloud Computing Projects

    Networking Projects

    Final Year Projects for CSE

    JavaScript Training in Chennai

    JavaScript Training in Chennai

    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete
  2. The layers that are obvious on the Layers board show up in the chose casing, and subsequently, in the animation. anime subthai

    ReplyDelete
  3. ดูหนังออนไลน์I have learn a few just right stuff here. Certainly value bookmarking
    for revisiting. I wonder how so much effort you set to make this kind of excellent informative website.

    ReplyDelete
  4. As we mentioned, critiques and testimonials could be bought at comparatively low-cost prices whereas unfavorable critiques could be moderated or deleted. One of vital thing} features of any well-liked crypto playing website is its provably fair mechanism. The encryption on these 토토사이트 web sites ensures that the home can by no means cheat you, and that you'll always have a good recreation. Preferences can differ, and therefore you must to} examine your favorite forms of games can be found.

    ReplyDelete
  5. I was looking for this kind of unique information. This article is very helpful for me. I really appreciate your source code technique, which is impressive. Keep sharing more information about this article. Now it's time to get Roofing Services in Wayne NJ for more information.

    ReplyDelete

Post a Comment