Breaking

Arduino

Display Images in OLED Display


Introduction 

In this tutorial, we are going to learn about how to display images in monochrome OLED displays.
Here We are only going to learn about the software part, to learn about interfacing OLED with Arduino click this link http://www.diyusthad.com/2019/02/interfacing-oled-128x64-i2c-with.html
or watch this video here


Hardware Required

Arduino UNO x 1
OLED 128x64 or any other OLEDs 1
Breadboard x 1
 Jumber cable x 1

Video

Converting Image to bitmap HEX code

To display an image in OLED display first We need to convert the image to HEX code, for that purpose We need to use a converter like image2cpp by javl 

Step 1: Open Converter

Click on the image2cpp button and open the application in a new tab.

Step 2: Choose Image File

Click on choose files and choose the image file which you need to display in the OLED.

I just opened a facebook logo image 

Step 3: Image Settings 

Below is the screenshot of the default settings when We open the facebook logo.


Here We need to change at least the canvas size, scaling, and brightness threshold to get a proper output in our OLED display. 

Canvas Size:  it  is the size of our OLED display in my case its 128x64 is you are using any other OLED display then change the settings accordingly

Brightness Threshold: It is for adjusting the intensity with respect to the background, You can understand it correctly with using the application.

Scaling:  It is for adjusting the image size with respect to the Canvas Size.

Below is the screenshot after updating the settings.

Now We got our nice looking facebook logo, I have to change the canvas size to "128 x 64", brightness threshold to "185", scaling to "scale to fit, keeping proportion". The other settings like center, background color and invert image colors are for tweaking, play with it to understand :).

Step 4: Generate Code

From code output, formate dropdown menu selects the Arduino code and click on the Generate code button.

Now We have successfully generated the HEX code for our image, Let's move to Arduino coding.

Arduino Coding

Copy the code below to a new Arduino sketch 


Now copy the above-generated HEX code just above the void Setup() function in the Arduino code.
so it will look like this


Now select the board and port from the tools menu and upload the code, that's it now Our OLED will start displaying the image.


Complete video tutorial 


Note: If you don't know to interface OLED with Arduino click here

Display Images in OLED Display Reviewed by Abu Yazid on February 25, 2019 Rating: 5

No comments:

All Rights Reserved by DIY Usthad © 2014 - 2019

Contact Form

Name

Email *

Message *

Powered by Blogger.