This is an example of using the Seed 96x96 OLED display. This display uses a SSD1327 driver. The example was developed on a Seed Arch Pro platform and the display was connected to the I2C grove connector.

Dependencies:   SeeedGrayOLED mbed

Committer:
danielashercohen
Date:
Sat Dec 20 06:55:21 2014 +0000
Revision:
1:965b23180062
Parent:
0:6819eb60f94a
This is an example program for the Seeed 96x96 OLED display that uses a SSD1327 driver.  This should work for other OLED displays that use a SSD1327 driver as well.  The example was developed on a Seed Arch Pro platform

Who changed what in which revision?

UserRevisionLine numberNew contents of line
danielashercohen 0:6819eb60f94a 1 /*
danielashercohen 0:6819eb60f94a 2 * Copyright (c) 2012 Neal Horman - http://www.wanlink.com
danielashercohen 0:6819eb60f94a 3 *
danielashercohen 0:6819eb60f94a 4 * License: MIT open source (http://opensource.org/licenses/MIT)
danielashercohen 0:6819eb60f94a 5 * Summary;
danielashercohen 0:6819eb60f94a 6 * Use / modify / distribute / publish it how you want and
danielashercohen 0:6819eb60f94a 7 * if you use it, or don't, you can't hold me liable for how
danielashercohen 0:6819eb60f94a 8 * it does or doesn't work.
danielashercohen 0:6819eb60f94a 9 * If it doesn't work how you want, don't use it, or change
danielashercohen 0:6819eb60f94a 10 * it so that it does work.
danielashercohen 0:6819eb60f94a 11 */
danielashercohen 0:6819eb60f94a 12
danielashercohen 0:6819eb60f94a 13 #include "mbed.h"
danielashercohen 0:6819eb60f94a 14 #include "SeeedGrayOLED.h"
danielashercohen 0:6819eb60f94a 15
danielashercohen 0:6819eb60f94a 16 DigitalOut myled(LED1);
danielashercohen 0:6819eb60f94a 17
danielashercohen 0:6819eb60f94a 18 SeeedGrayOLED SeeedGrayOled(P0_10, P0_11);
danielashercohen 0:6819eb60f94a 19
danielashercohen 0:6819eb60f94a 20 int main()
danielashercohen 0:6819eb60f94a 21 {
danielashercohen 0:6819eb60f94a 22
danielashercohen 0:6819eb60f94a 23 while(1) {
danielashercohen 0:6819eb60f94a 24 SeeedGrayOled.init(); //initialize SEEED OLED display
danielashercohen 0:6819eb60f94a 25 SeeedGrayOled.clearDisplay(); //Clear Display.
danielashercohen 0:6819eb60f94a 26 SeeedGrayOled.setNormalDisplay(); //Set Normal Display Mode
danielashercohen 0:6819eb60f94a 27 SeeedGrayOled.setVerticalMode(); // Set to vertical mode for displaying text
danielashercohen 0:6819eb60f94a 28
danielashercohen 0:6819eb60f94a 29 for(char i=1; i < 11 ; i++) {
danielashercohen 0:6819eb60f94a 30 SeeedGrayOled.setTextXY(i,0); //set Cursor to first line, 0th column
danielashercohen 0:6819eb60f94a 31 SeeedGrayOled.setGrayLevel(i); //Set Grayscale level. Any number between 0 - 15.
danielashercohen 0:6819eb60f94a 32 SeeedGrayOled.putString("Hello World"); //Print Hello World
danielashercohen 0:6819eb60f94a 33 wait_ms(1.0);
danielashercohen 0:6819eb60f94a 34 }
danielashercohen 0:6819eb60f94a 35
danielashercohen 0:6819eb60f94a 36 wait(5.0);
danielashercohen 0:6819eb60f94a 37 }
danielashercohen 0:6819eb60f94a 38
danielashercohen 0:6819eb60f94a 39 }