0.96 oled display

In this Project, we will see about how to interface 0.96" OLED Display with Arduino .

Circuit Diagram:

Arduino Code:
oled_code.ino
//This Code is Developed by Sdev
//Follow Us Here : https://youtube.com/sdevelectronics

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

#define SCREEN_WIDTH 128                                // OLED display width, in pixels
#define SCREEN_HEIGHT 64                                // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     4                                // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define MYDELAY 4000
void setup() {
  Serial.begin(9600);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {     // Address 0x3C for 128x32
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);                                           // Don't proceed, loop forever
  }
  display.clearDisplay();
  delay(2000);

  //Display Simple Text
  display.setTextSize(1);                               //Text Size
  display.setTextColor(WHITE);                          //Color
  display.setCursor(0, 0);                              //start_x,start_y
  display.println("Hello, world");                      //your text
  display.display();
  delay(2000);
  display.clearDisplay();

  //Draw A Pixel(Point)
  display.drawPixel(64, 32, WHITE);                     //x,y,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Line
  display.drawLine(10, 5, 80, 40, WHITE);               //start_x,start_y,end_x,end_y,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Rectangle
  display.drawRect(14, 7, 100, 50, WHITE);              //start_x,start_y,width,height,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Fill-Rectangle
  display.fillRect(14, 7, 100, 50, WHITE);              //start_x,start_y,width,height,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Round Rectangle
  display.drawRoundRect(14, 7, 100, 50, 10, WHITE);     //start_x,start_y,width,height,corner_radius,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //  //Draw a Round Fill-Rectangle
  display.fillRoundRect(14, 7, 100, 50, 10, WHITE);     //start_x,start_y,width,height,corner_radius,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Circle
  display.drawCircle(64, 32, 15, WHITE);                //centre_x,centre_y,radius,color
  display.display();
  delay(MYDELAY);
  display.clearDisplay();

  //Draw a Fill-Circle
  display.fillCircle(64, 32, 15, WHITE);                //centre_x,centre_y,radius,color
  display.display();
  delay(MYDELAY);
}

void loop() {
}

Libraries Used:

Youtube Video Tutorial:




Download our official Android App in PlayStore. Click Here
You can get the all the required files (like Circuit Diagram, Arduino.ino file, Libraries Used, and others) for the project  in ZIP format and much more...

1 comment:

  1. Do you realize there's a 12 word sentence you can speak to your man... that will induce intense feelings of love and impulsive attraction to you deep within his heart?

    Because hidden in these 12 words is a "secret signal" that triggers a man's impulse to love, cherish and guard you with all his heart...

    12 Words Will Fuel A Man's Love Instinct

    This impulse is so hardwired into a man's mind that it will drive him to work harder than before to make your relationship the best part of both of your lives.

    In fact, triggering this influential impulse is absolutely binding to getting the best ever relationship with your man that the second you send your man one of these "Secret Signals"...

    ...You will instantly notice him expose his mind and soul to you in a way he's never experienced before and he will perceive you as the one and only woman in the universe who has ever truly fascinated him.

    ReplyDelete