Arduino I2C OLED screen tutorial using U8GlibTslaPosted on February 24, 2019March 2, 20240
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
Arduino
OLED
3.3V
Vdd
Gnd
Gnd
Analog 4
SDA
Analog 5
SCK
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 ZIP
Method 2:
Or go to sketch > include library > manage libraries > type u8glib in the search bar and click on 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.
Related Posts:
Arduino I2C SSD1306 OLED screen tutorial
ESP32 Web Server, Web Sockets And HTTP API Calls
8-Bit Computer In An FPGA
Programming The Attiny45 With An Arduino As ISP Programmer
Arduino RCA Video Output to TV
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
Email
Website
Save my name, email, and website in this browser for the next time I comment.
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
Follow us
youtube
pinterest
github
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