Arduino I2C OLED Screen Tutorial Using U8Glib - The EECS Blog

Skip to contentSearch for: SearchArduino I2C OLED screen tutorial using U8GlibTslaPosted on February 24, 2019March 2, 20240arduino oled display ssd1306 u8glib

About

This tutorial covers how to connect an SSD1306 0.96 inch OLED screen to an Arduino Nano over I2C and display text on it using the U8Glib library.

Hardware Used

  • #adAmazon LinkArduino Nano
  • #adAmazon LinkSSD1306 OLED Screen
  • #adAmazon LinkBreadboard

Hardware Connections

ArduinoOLED
3.3VVdd
GndGnd
Analog 4SDA
Analog 5SCK
arduino oled display connectionsarduino nano oled ssd1306 wiring

U8Glib Install

In this tutorial, I will be using the U8Glib graphics library for the screen. In this tutorial, I do the same but using Adafruits SSD1306 graphics library. 

Method 1:

Downaload the library: https://github.com/olikraus/U8glib_Arduino/releases/tag/1.19.1

In the Arduino IDE :

sketch > include library > Add .ZIP Library > select the  downloaded ZIPArduino library manager

Method 2:

Or go to sketch > include library > manage libraries > type u8glib in the search bar and click on install.Arduino Library Manager u8Glib install

Code

Here is the bare minimum code to make the display work. If you need more info about the library check out the documentation on GitHub. You can find more examples provided in the Arduino IDE: File > Examples > U8glib.//Include the graphics library. #include "U8glib.h" //Initialize display. U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_DEV_0); void setup(void) { //Set font. u8g.setFont(u8g_font_unifont); } void loop(void) { u8g.firstPage(); do { draw(); } while (u8g.nextPage()); //Delay before repeating the loop. delay(50); } void draw(void) { //Write text. (x, y, text) u8g.drawStr(20, 40, "Hello World."); }

Hello World!

Upload the above-provided code and you should have a  Hello World.ssd1306 display text

Related Posts:

  • arduino I2C SSD1306 OLED screen tutorial
    Arduino I2C SSD1306 OLED screen tutorial
  • ESP Web Server
    ESP32 Web Server, Web Sockets And HTTP API Calls
  • 8-bit computer in an FPGA thumbnail
    8-Bit Computer In An FPGA
  • Attiny Arduino programming shiled
    Programming The Attiny45 With An Arduino As ISP Programmer
  • TV RCA Output with Arduino
    Arduino RCA Video Output to TV
  • arduino cpu and ram display
    Sending multiple values over serial to Arduino
Categories: Arduino Digital Electronics Electronics Embedded Systems MicrocontrollersTags: arduino/ SSD1306/ tutorial/ U8Glib

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Comment *

Name

Website

The following GDPR rules must be read and accepted: I agreeThis form collects your name, email and content so that we can keep track of the comments placed on the website. For more info check our privacy policy where you will get more info on where, how and why we store your data.

Notify me of replies to my comments via e-mail.

Δ

Post navigation

« Arduino I2C SSD1306 OLED screen tutorialWindows C# app Arduino control over serial port »Search for: Search

Recent Posts

  • Interrupts And Timers
  • Watchdog Timer
  • ESP32 FreeRTOS Tutorial
the eecs blog online store white background

Follow us

Donate

Donate Crypto Here

Archives

Archives Select Month November 2025 September 2025 June 2025 December 2024 October 2024 September 2024 August 2024 June 2024 February 2024 January 2024 December 2023 November 2023 September 2023 August 2023 March 2023 February 2023 November 2022 September 2022 August 2022 February 2022 January 2022 December 2021 October 2021 September 2021 August 2021 July 2021 June 2021 September 2020 July 2020 June 2020 April 2020 March 2020 February 2020 January 2020 December 2019 November 2019 October 2019 September 2019 August 2019 July 2019 June 2019 May 2019 April 2019 March 2019 February 2019 January 2019

Categories

CategoriesSelect CategoryArduinoC#ComputersDigital ElectronicsElectronicsEmbedded SystemsFPGAJavascriptMicrocontrollersPHPProgrammingRaspberry PiRCRC HardwareRC SoftwareRepairReviewSecurity And Hacking

Tag » Arduino Oled Library U8glib