Hugo Gomes
Published © GPL3+

Get Started With 0.5" OLED Display

Do you need a really, really small OLED display? Search no more, and check out this tutorial.

EasyProtip1 hour457
Get Started With 0.5" OLED Display

Things used in this project

Hardware components

DFRobot SPI/I2C Monochrome 60x32 0.5" OLED Display for Arduino
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
DFRobot Arduino Jumper Cables (M/M) (65 Pack)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Dfr0376 line 2ci2q7uz89

Code

Sample Code

Arduino
#include "U8glib.h"
U8GLIB_LD7032_60x32 u8g(9, 8, 11, 10, 12);

void setup(void) {
}
const uint8_t rook_bitmap[] PROGMEM = {
  0x00,         // 00000000
  0x55,         // 01010101
  0x7f,          // 01111111
  0x3e,         // 00111110
  0x3e,         // 00111110
  0x3e,         // 00111110
  0x3e,         // 00111110
  0x7f           // 01111111
};

void loop(void) {
  // picture loop
  u8g.firstPage();
  do {
    u8g.setFont(u8g_font_unifont);
    //       u8g.setFont(u8g_font_osb21);
    u8g.drawStr( 5, 20, "DFROBOT");
  } while ( u8g.nextPage() );
  delay(1000);
  u8g.firstPage();
  do {
    u8g.drawCircle(30, 20, 18);
    u8g.drawEllipse(26, 12, 7, 5,U8G_DRAW_UPPER_LEFT );
    u8g.drawEllipse(34, 12, 7, 5, U8G_DRAW_UPPER_RIGHT);
    u8g.drawTriangle(30,14, 27, 18, 33, 18);
    u8g.drawFilledEllipse( 30, 25, 10,5, U8G_DRAW_LOWER_LEFT);
    u8g.drawFilledEllipse( 30, 25, 10,5, U8G_DRAW_LOWER_RIGHT);
    u8g.drawLine(30, 13, 30, 16);
    
    
    u8g.drawFrame(0, 0,60 ,32);
    
  } while ( u8g.nextPage() );
  delay(5000);

  u8g.firstPage();
  do {
    u8g.drawBitmapP(30, 16,1, 8, rook_bitmap);
  } while ( u8g.nextPage() );
  delay(1000);
  u8g.firstPage();
  do {

  } while ( u8g.nextPage() );
  delay(2000);

}

Credits

Hugo Gomes

Hugo Gomes

10 projects • 58 followers
http://www.hugogomes.net Youtube Channel - https://goo.gl/fnQLJo
Contact

Comments