Example driver for 4D Systems uOLED-160-G1 library

Dependencies:   OLED160G1 mbed

Files at this revision

API Documentation at this revision

Comitter:
sblair
Date:
Sun Dec 19 16:46:28 2010 +0000
Commit message:
Initial version

Changed in this revision

OLED160G1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 78da45c89d9b OLED160G1.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OLED160G1.lib	Sun Dec 19 16:46:28 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sblair/code/OLED160G1/#296a7ee30b3a
diff -r 000000000000 -r 78da45c89d9b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Dec 19 16:46:28 2010 +0000
@@ -0,0 +1,43 @@
+#include "mbed.h"
+#include "OLED160G1.h"
+
+#define PI          3.1415926535897932384626433832795
+
+OLED160G1 oled(p9, p10, p8);
+
+int main() {
+    oled.init();
+    oled.eraseScreen();
+    oled.setTextBackgroundType(OLED_SET_TEXT_OPAQUE);
+
+    oled.printf("\n4D Systems 160 x 128 OLED\nmbed driver");
+
+    wait(2);
+    
+    oled.drawLine(0, 0, 159, 127, oled.toRGB(0, 0, 255));
+    wait_ms(100);
+    oled.drawLine(159, 0, 0, 127, oled.toRGB(0, 0, 255));
+
+    wait(2);
+
+    for (int i = 0; i < 50; i += 1) {
+        oled.drawCircle(80, 60, 3 * i, oled.toRGB(255, 0, 0));
+        wait_ms(50);
+    }
+
+    for (int i = 0; i < 50; i += 1) {
+        oled.drawCircle(80, 60, 3 * i, oled.toRGB(0, 0, 0));
+        wait_ms(50);
+    }
+    
+    wait(2);
+    
+    oled.eraseScreen();
+    oled.displayControl(OLED_COMMAND_DISPLAY, 0);
+    oled.displayControl(OLED_COMMAND_POWER, 0);
+
+    while (1) {
+
+    }
+}
+
diff -r 000000000000 -r 78da45c89d9b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Dec 19 16:46:28 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e