Description:
The Microduino (TM) OLED display (blue-green)is a tiny 128 x 64 pixel display desined for use with the Microduino range of Core and Core+ boards. It is based upon the common SSD1306 driver IC and uses an I2C interface for communication. This means that only 2 wires are required to control this display (excluding power and GND).
Specification:
Resolution 128x64
Interface: I2C
Power: 3.3V
Schematic:
Datasheet:
SSD1306 controller datasheet: Microduino/Arduino Library:
There are several libraries available for this module. For the example sketch below we have used the MicroLCD library developed by Stanley Huang.
A snapshot can be downloaded here:
Example Sketch:
Code: Select all
/* FILE: ARD_Microduino_OLED_Display_Example
DATE: 23/08/13
VERSION: 0.1
REVISIONS:
23/08/13 Created version 0.1
This is an example of how to use the Mictoduino OLED 128x64 graphic display
(HCMIDU0011). The sketch uses the MicroLCD library developed by Stanley
Huang <stanleyhuangyc@live.com> to display some example text and graphics.
PINOUT:
MODULE Core Core+ UNO
GND GND GND GND
3V3 3V3 3V3 3.3V
SDA A4 D20 A4
SCL A5 D21 A5
PLEASE NOTE THAT THIS DISPLAY IS 3.3V ONLY. Connecting this display to a 5V
supply will perminantly damage it.
You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of premoting or selling products
that directly compete with Hobby Components Ltd's own range of products.
THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
/* Include the standard Arduino header and Wire library */
#include <Arduino.h>
#include <Wire.h>
/* Include the MicroLCD library */
#include <MicroLCD.h>
/* Create an instance of the library */
LCD_SSD1306 OLED;
/* Create an example graphic and store it in program space */
static const PROGMEM uint8_t Resistor[128 * 24 / 8] =
{0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xF0,0x7C,0x3E,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0xE0,0xF8,0x3E,0x3E,0xF8,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0x3E,0x3E,0xF8,0xE0,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xF0,0xFC,0x3E,0x7C,0xF0,0xC0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x00,0x00,
0x00,0x3C,0x7E,0xE7,0xC3,0xC3,0xC3,0xC3,0xFF,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x78,0xF0,0xC0,0x00,0x00,0x00,0x00,0xC0,0xF0,0x7C,
0x1F,0x07,0x01,0x00,0x00,0x00,0x03,0x0F,0x3F,0xFC,0xF0,0xC0,0x00,0x00,0x00,0x80,
0xE0,0xF8,0x3E,0x0F,0x03,0x00,0x00,0x00,0x00,0x03,0x0F,0x3E,0xF8,0xE0,0x80,0x00,
0x00,0x00,0x80,0xE0,0xF8,0x3E,0x0F,0x03,0x00,0x00,0x00,0x00,0x03,0x0F,0x3E,0xF8,
0xE0,0x80,0x00,0x00,0x00,0xC0,0xF0,0xFC,0x3F,0x0F,0x03,0x00,0x00,0x00,0x01,0x07,
0x1F,0x7C,0xF0,0xC0,0x00,0x00,0x00,0x00,0xC0,0xF0,0x78,0x18,0x18,0x18,0x18,0x18,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0xFF,0xC3,0xC3,0xC3,0xC3,0xE7,0x7E,0x3C,
0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x1F,0x7C,0x7C,0x1F,0x07,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0F,0x3F,0x7C,0x3E,0x0F,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0F,0x3E,
0xFC,0x3E,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x0F,0x3E,0x7C,0x3F,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x01,0x07,0x1F,0x7C,0x7C,0x1F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00};
/* Initialise the display */
void setup()
{
OLED.begin();
}
/* Main program */
void loop()
{
/* Clear the display */
OLED.clear();
/* Display some text */
OLED.setCursor(42, 0);
OLED.setFont(FONT_SIZE_MEDIUM);
OLED.print("HOBBY");
OLED.setCursor(20, 2);
OLED.print("COMPONENTS");
/* Display the graphic */
OLED.draw(Resistor, 0, 40, 128, 24);
/* Nothing left to do */
while(1);
}