WIP demo program for using my Hexidraw library

Dependencies:   Hexidraw

Demo app for using my Hexidraw library for drawing on the Hexiwear's OLED

Files at this revision

API Documentation at this revision

Comitter:
keithm01
Date:
Fri Aug 19 01:18:32 2016 +0000
Child:
1:e5806bc5d2e9
Commit message:
initial;

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
Hexidraw.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-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Fri Aug 19 01:18:32 2016 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Hexidraw.lib	Fri Aug 19 01:18:32 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/keithm01/code/Hexidraw/#2d3fcb6dabd4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Aug 19 01:18:32 2016 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+#include "hexidraw.h"
+
+//DigitalOut led_red(PTC8);
+//DigitalOut led_green(PTD0);
+DigitalOut led_blue(PTC9);
+
+OLED oled;
+
+// main() runs in its own thread in the OS
+// (note the calls to Thread::wait below for delays)
+int main() {
+    oled.begin();
+    oled.wake();
+    
+    oled.rect(0, 0, OLED_WIDTH, OLED_HEIGHT, BLACK);
+    oled.pixel(1, 1, Color565(0, 255, 0));
+    uint16_t c1 = Color565(255, 0, 0);
+    uint16_t c2 = Color565(0, 255, 0);
+    uint16_t c3 = Color565(0, 0, 255);
+    uint8_t i = 0;
+    while (true) {
+        if(i == 0)
+            oled.rect(0, 0, OLED_WIDTH, OLED_HEIGHT, c1);
+        if(i == 1)
+            oled.rect(0, 0, OLED_WIDTH, OLED_HEIGHT, c2);
+        if(i == 2)
+            oled.rect(0, 0, OLED_WIDTH, OLED_HEIGHT, c3);
+        led_blue = !led_blue;
+        Thread::wait(500);
+        ++i;
+        if(i > 2)
+        i = 0;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Aug 19 01:18:32 2016 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#0712b8adf6bbc7eb796d5dac26f95d79d40745ef