2.7 OLED 12864 Display Module wiki-DFRobot

FIT0328 2.7 OLED 128x64 Display Module

Introduction

We are always looking for a display with high picture quality and affordable cost. Thus almost all the OLED display available on the market are selected to compare size, color, material, workmanship, user experience and etc. At last we find this graceful display -- 2.7 inch, white color, good image quality, wide viewing angles, black mental frame, hard frosted surface and the most important, Arduino compatible.

Without a backlight, the OLED display can offer pure black color, which is extremely cool when you use it in a dark room or at night. Meanwhile, lack of backlight makes it thinner and lighter. The thickness is less than half of the normal LCD display.

This display provides 128x64 pixels, which is highly suitable for the Arduino controller. Thus by using hardware SPI, the response can be very fast. Meanwhile the powerful "u8glib" library for Arduino makes it easy to use. You will certainly enjoy this incredible and beautiful OLED display!

Caution: This module doesn't include the 20 Pin Header. You can buy them Here or directly solder the wire to this module.

Specification

Connection Diagram

FIT0328 2.7 OLED 128x64 Display Module Connection Diagram FIT0328 2.7 OLED 128x64 Display Module Connection Diagram

If using the following code and the OLED doesn't work, try to press the reset button on the micro controller board.

Sample Code

#include "U8glib.h"

U8GLIB_NHD27OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9

void draw(void) {
  // graphic commands to redraw the complete screen should be placed here
  u8g.setFont(u8g_font_unifont);
  //u8g.setFont(u8g_font_osb21);
  u8g.drawStr( 0, 22, "Hello World!");
}

void setup(void) {

  // flip screen, if required
  // u8g.setRot180();

  // set SPI backup if required
  //u8g.setHardwareBackup(u8g_backup_avr_spi);

  // assign default color value
  if ( u8g.getMode() == U8G_MODE_R3G3B2 )
    u8g.setColorIndex(255);     // white
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
    u8g.setColorIndex(3);         // max intensity
  else if ( u8g.getMode() == U8G_MODE_BW )
    u8g.setColorIndex(1);         // pixel on
}

void loop(void) {
  // picture loop
  u8g.firstPage();
  do {
    draw();
  } while( u8g.nextPage() );

  // rebuild the picture after some delay
  delay(500);
}

More Documents