Experiment 1 Using an OLED to Display a Picture

Share for us

In this routine, we will learn how to use an OLED to display a simple picture. This requires you modulo the picture that you want to display. Here we use special modulus software to complete this process.


SunFounder Uno R3 * 1

0.96 Inch OLED * 1

USB Data Cable * 1

Jumper Wires


First, connect the circuit

                                           SunFounder Uno                   OLED

                                           SCL ------------------------------ SCL

                                           SDA ----------------------------- SDA 

                                           3.3V ----------------------------- VCC 

                                           GND ----------------------------- GND

Second, generate a 128*64 pixels picture with .bmp format  (you can also generate a random less than 128 * 64 pixels image, here we take 128 * 64 pixels image for example) by Photoshop or other similar software, as shown in figure 9.

Figure 9

Open the modulus software we provide, you will see the following picture as shown in figure 10.

Click the icon in the red box on the left to open the previously generated picture, as shown in figure 11:

After opened, as shown in figure 12:

Click the option in the red box on the left to select modulus method, as shown in figure 13:

Now, the following picture will appear, as shown in figure 14:

Click the option in the red box on the left to select C51 format, as shown in figure 15:

Now, you will see the following picture, the contents in the red box display generated code.

Paste the code as shown in figure 17 to ”bitmap.h” in code ”picture” we provide, save and exit.

Third, program (please go to our official website www.sunfounder.com to download the example code by clicking LEARN -> Get Tutorials)

Fourth, since in some code, the libraries needed are not included in Arduino, so we need to add them before compiling. Add the files in the libraries folder under the path 11.OLED/code, i.e. the package you just downloaded, to the libraries folder in Arduino (if you cannot find the path in Arduino, open Arduino IDE, click File ->Preferences, and you can see the path on the top input box, as shown in the following diagram). 

Fifth, burn the program into SunFounder Uno R3 board

After all the above steps, you will see the following phenomenon on OLED.