OLED I2C DISPLAY WITH ARDUINO Tutorial

Thanks for Visiting here

Print Friendly and PDF

OLED I2C DISPLAY WITH ARDUINO Tutorial

Welcome guys Today we will Learn About OLED Display that is very easy and simple to learn. OLED I2C is a small type of display in that we can print a small amount of data in that. 
OLED I2C DISPLAY WITH ARDUINO Tutorial

Since this OLED works on I2C Communication, we have to connect

only 4 pins to Arduino

OLED has Sck (i.e. clock), SDA (i.e. Data) and Power pins i.e VCC and Ground.

On the Arduino UNO Board, we have SDA at A4 and SCK at A5.

Connections for OLED to Arduino

  • Vcc - 5V
  • Gnd - Gnd
  • SDA - A4
  • SCK - A5
  • I2C Scanner

    I2C Scanner
    I2C Scanner

    we know each I2C device has a different Hexadecimal Address.

    since this OLED uses the I2C communication protocol, we have to find the I2C address for the display.

    /* I2C Address Finder
    * for " Arduino LCD I2C Tutorial| How to Program LCD Display"
    * subscribe for more arduino Tuorials and Projects

    https://www.youtube.com/channel/UCM6rbuieQBBLFsxs...

    */

    #include < wire.h>


    void setup()

    {
    Serial.begin (115200);
    while (!Serial)
    {
    }

    Serial.println ();
    Serial.println ("I2C scanner. Scanning ...");
    byte count = 0;
    pinMode(13,OUTPUT);
    digitalWrite(13,HIGH);
    Wire.begin();
    for (byte i = 1; i < 120; i++)

    void loop() {}

Code Parts

then Include these 4 Libraries in the header

#include <spi.h>
#include <wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


#include<SPI.h>
#include<Wire.h>
#include<Adafruit_GFX.h>
#include<Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
  // put your setup code here, to run once:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
}

void loop() {
  // put your main code here, to run repeatedly:
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("Welcome TO Home");
display.display();

}


Thank you for  Reading 📖 

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad