Grove OLED Display 1.12inch
Our new 1.12” OLED displays are perfect when you need a small display with 16 grayscale. The visible portion of the OLED measures 1.12” diagonal and contains 96x96 grayscale pixels. Because the display uses OLEDs, there is no backlight, and the contrast is very high.
This OLED uses the SSD1327(V1.0) or SH1107G(V2.1) driver chip, which manages the display. You can talk to the driver chip using 4-wire I2C (clock, data, power, and GND pins).
Communicate Mode: I2C
Grayscale Display: 16 Gray shades.
Supports both Normal and Inverse Color Display.
Supports Continuous Horizontal Scrolling.
Grove compatible Interface
Version
Specifications
Platforms Supported
Getting Started
!!!Note This chapter is based on Win10 and Arduino IDE 1.6.9
Hardware
Here we will show you how this Grove - OLED Display works via a simple demo. First of all, you need to prepare the below stuffs:
This is an easy-to-use module, what you need to do is connect the module to I2C port of a Base Shield. There're 4 pins, defined as below.
Grove - OLED Display 1.12`` is an I2C module, we connect it to I2C port at this demo.
Software
Please follow how to install an arduino library procedures to install library.
Unzip the file and put to libraries folder of your Arduino IDE. There're many examples in this library, which is consist of
OLED_Bitmap_Inverse_Display
OLED_Draw_Bitmap
OLED_Hello_World
OLED_Inverse_Display
OLED_PrintNumbers
OLED_Scroll_Left
OLED_Scroll_Right
OLED_Z_Display_Driver_Test_Suite
!!!Note Please change the parameter of the SeeedGrayOled.init() base on different version. For V1.0, please config as SeeedGrayOled.init(SSD1327). For V2.1, please config as SeeedGrayOled.init(SH1107G).
Now let's try upload OLED_Hello_World to Seeeduino V4. Open your Arduino IDE, click on File > Example > OLED_Display_96x96-master > OLED_Hello_World
Then please try the other examples to see what will happen.
APIs of the library
Seeed Gray OLED library provides complete software interfaces to exercise the capabilities of SSD1327Z driver with a 96x96 gray OLED. Almost all useful features are implemented and all functions are in public scope. This makes Seeed Gray OLED Library extensible. Seeed Gray OLED library uses Arduino Wire library. Hence initialize wire library before initializing Seeed OLED library.
init()
Initializes the Seeed OLED frame and sets the display to Normal mode.
Example:
clearDisplay()
Clears the whole screen. Should be used before starting a fresh start or after scroll deactivation. This function also sets the cursor to top left corner.
Example:
setNormalDisplay()
Configures the display to normal mode(non-inverse) mode.
Example:
setContrastLevel(unsigned char ContrastLevel)
Set the contrast ratio of OLED display. ContrastLevel can be any number from 0 - 255. Example:
setInverseDisplay()
Configures the display to inverse mode. Example:
setHorizontalMode()
Configures the display to horizontal addressing mode. Example:
setVerticalMode()
Configures the display to vertical addressing mode. Texts are drawn in vertical mode. Please set the display to vertical mode before printing text. Example:
setTextXY(X,Y)
Set the text's position (cursor) to Xth Text Row, Yth Text Column.96x96 OLED is divided into 12 rows and 12 Columns of text. This row and column should not be confused with OLED Row and Column.
X can be any number from 0 - 11.
Y can be any number from 0 - 11.
Example:
putChar(unsigned char c)
Print a character to OLED display starting from current address-pointer set by setTextXY(X,Y). This function is internally used by putString().
Example:
putString(cont char *string)
Print string to OLED display starting from current address-pointer set by setTextXY(X,Y) Example:
putNumber(long n)
Print numbers to OLED display starting from current address-pointer set by setTextXY(X,Y). Number can be any char,int or long datatype. It also takes care of -ve sign.
Example:
drawBitmap(unsigned char *bitmaparray, int bytes)
Display a binary bitmap on the OLED matrix. The data is provided through a pointer to uni-dimensional array holding bitmap. The bitmap data is available in continuous rows of columns as like Horizontal Addressing mode. bytes is size of bitmap in bytes.
Example:
setHorizontalScrollProperties
Set the properties of horizontal scroll.
Direction can be any of Scroll_Left and Scroll_Right.
startRow can be 0 - 127
endRow can be 0 - 127. It should be greater than startRow
startColumn can be 0 - 63
endColumn can be 0 - 63. It should be greater than startRow
scrollSpeed can be any of defines:Scroll_2Frames, Scroll_3Frames, Scroll_4Frames, Scroll_5Frames, Scroll_25Frames,Scroll_64Frames, Scroll_128Frames,Scroll_256Frames.
Example:
activateScroll()
Enable scrolling. This should be used only after setting horizontal scroll properties. Example:
deactivateScroll()
Disable scrolling. This should be used after activateScroll(); Example:
Resources
[Library] Github Repository of the Library
[Datasheet] SSD1327 Datasheet
[Datasheet] LY120 Datasheet
[Datasheet] SH1107G_datasheet
Last updated