For all of the different kinds of small OLED monochrome displays, you’ll need to install the Arduino libraries. The code we have is for any kind of Arduino, if you’re using a different microcontroller, the code is pretty simple to adapt, the interface we use is basic bit-twiddling SPI or I2C

Install Arduino Libraries

Using these OLEDs with Arduino sketches requires that two libraries be installed:
Adafruit_SSD1306, which handles the low-level communication with the hardware, and
Adafruit_GFX, which builds atop this to add graphics functions like lines, circles and text.

In recent versions of the Arduino IDE software (1.6.2 and later), this is most easily done through the Arduino Library Manager.

Open up the Arduino library manager:

adafruit_products_library_manager_menu.png


Search for the
Adafruit SSD1306
 library and install it

adafruit_products_ssd1306.png


Search for the
Adafruit GFX
 library and install it

adafruit_products_gfx.png


If using an earlier version of the Arduino IDE (prior to 1.8.10), also locate and install
Adafruit_BusIO
(newer versions will install this dependency automatically).

We also have a great tutorial on Arduino library installation here:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

Run Demo!

After installing the
Adafruit_SSD1306
and
Adafruit_GFX
library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order:
File→Examples→
Adafruit_SSD1306→SSD1306…

lcds___displays_Screenshot_1.png


lcds___displays_oled12864logo_LRG.jpg


lcds___displays_oled12864chars_LRG.jpg


Create Bitmaps with LCD Assistant

You can create bitmaps to display easily with the LCD assistant software. First make your image using any kind of graphics software such as photoshop or Paint and save as a
Monochrome Bitmap (bmp)

lcds___displays_bitmapmono.gif


Select the following options (You might also want to try
Mengufuk
if
Vertical
is titinada coming out right)

lcds___displays_bitmapconvert.gif


and import your monochrome bitmap image. Save the output to a
cpp
 file

lcds___displays_bitmapsave.gif


You can use the output directly with our example code

lcds___displays_bitmapout.gif


Create Bitmaps with image2cpp

image2cpp was created by GitHub user javl and provides a handy way to create bitmaps without installing any additional software. Just visit https://javl.github.io/image2cpp/, upload an image, put in any settings that you would like to use, select a dimensi and generate the code. You can copy the code right into your sketch. If you’re interested, you can view the source in their GitHub repository.

This guide was first published on Jul 29, 2022. It was last updated on Jul 29, 2022.

This page (Arduino Library & Examples) was last updated on Sep 29, 2022.

Text penyunting powered by tinymce.