Arduino Tutorials – Lesson 34 – OLED Display Using Arduino UNO

To give the input (Numbers) to Serial Monitor and get the output in OLED Display.

Required Components

  1. OLED Display -1 no
  2. Arduino UNO Board -1 no
  3. USB Cable -1 no
  4. Connecting wires -1 set

Circuit

Steps

  1. Make sure the components are working properly.
  2. Connect OLED Display gnd & VCC to the Arduino UNO Board gnd & 5V.
  3. Connect Arduino pin A4 & A5 to the OLED Display SDA & SCL.
  4. Check the Arduino program.
  5. Check the circuit connections.
  6. Run the Arduino program.

Arduino Program

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

Adafruit_SSD1306 display(-1);

void setup()   
{                
  Serial.begin(9600);
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  
}

void loop() 
{
  if (Serial.available() > 0) 
  {   
    String a = Serial.readString();      
    display.clearDisplay();
    display.setTextSize(2);
    display.setTextColor(WHITE);
    display.setCursor(10,10);
    display.println(a);
    display.display();
    delay(2000);
    Serial.print("Number received: ");
    Serial.println(a);   
  } 
}

Usage

  1. TVs
  2. Cellphone screens
  3. Computer screens
  4. Keyboards
  5. Lights
  6. Portable device displays

Leave a Reply

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