April 4, 2013

Monochrome 128x32 OLED Display

I purchased a tiny OLED display from the eBay seller wide.hk that also have a webpage. The dimensions for the module is about 13x34 mm and the interface is I2C.

Here is how to get the display running with Arduino. Download and install both these adafruit libraries:

Hint: use the ZIP button on the github page to get all the files.

For installation instructions see my previous post.

Open the example ssd1306_128x32_i2c in the Arduino software. When compiling you will probably get this error mesage "ssd1306_128x32_i2c.ino:53:2: error: #error ("Height incorrect, please fix Adafruit_SSD1306.h!");"

To fix this open the newly installed library file: Adafruit_SSD1306.h
Find these lines in the file:
   #define SSD1306_128_64
//   #define SSD1306_128_32

change them to:
//   #define SSD1306_128_64
   #define SSD1306_128_32

Save the file and compile again. This time it should complete without errors.
Hint: Use CTRL+R to compile.

Connect your display to the Arduino UNO as follows:
  • ⏚ to GND
  • + to 5V
  • SDA to A4
  • SCL to A5
The library is also using pin 4 as reset. This display does not have a reset terminal so just leave it unconnected.

Upload the code to the Arduino and your display should wake up!
Hint: Use CTRL+U to Upload.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.