Demo of current functions .

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
DimiterK
Date:
Tue Jan 04 18:37:11 2011 +0000
Commit message:

Changed in this revision

KS0108.lib Show annotated file Show diff for this revision Revisions of this file
image.h 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 13c4589302f6 KS0108.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/KS0108.lib	Tue Jan 04 18:37:11 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/DimiterK/code/KS0108/#e4b50f4c13a8
diff -r 000000000000 -r 13c4589302f6 image.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/image.h	Tue Jan 04 18:37:11 2011 +0000
@@ -0,0 +1,71 @@
+#ifndef IMAGE_H
+#define IMAGE_H
+
+unsigned char pic[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 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, 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, 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, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE1, 0xC1, 0xC1, 0xC1,
+0xC1, 0x81, 0x81, 0x81, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1,
+0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
+0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC,
+0xFE, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07,
+0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x87, 0xC7, 0xE7, 0xE7, 0xE7, 0xC7, 0x07, 0x07, 0x07, 0x07, 0x07,
+0x07, 0x07, 0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0x00, 0x00, 0x00
+};
+
+#endif
diff -r 000000000000 -r 13c4589302f6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jan 04 18:37:11 2011 +0000
@@ -0,0 +1,62 @@
+#include "mbed.h"
+#include "KS0108.h"        
+#include "image.h"
+    
+KS0108 display (p13,p12, p14, p11, p21, p22, p30, p29, p28, p27, p26, p25, p24, p23);                        
+void testlib(int i);
+
+int main() {
+
+    display.ClearScreen();     
+    display.RoundRectangle(0,0,127,63,3,BLACK);
+    
+    while(1){          
+       
+       for(int i=0;i<7;i++){
+        testlib(i);    
+        wait(2);
+        display.ClearScreen();
+       }
+    }
+
+}
+
+void testlib(int i){
+
+    switch(i){
+         case 1:
+            for(int i=0;i<10;i++){
+            display.SetPixel(i*10,i+10,BLACK);    
+             }
+            break;
+         case 2:
+            display.HLine(20,70,30,BLACK);
+            display.HLineShort(30,20,50,BLACK);
+            display.VLine(20,40,30,BLACK);
+            display.VLineShort(70,5,50,BLACK);
+            display.SlantyLine(5,8,20,30,BLACK);
+            display.DegreeLine(15,30,30,6,20,BLACK); 
+             break;
+          case 3:
+            display.FullRectangle(10,30,15,34,BLACK);
+            display.EmptyRectangle(5,5,50,59,BLACK);
+            display.RoundRectangle(30,20,80,35,7,BLACK);                
+             break;
+          case 4:
+            display.EmptyCircle(60,20,10,BLACK);
+            display.FullCircle(40,30,5,BLACK);
+            display.PlotEllipse(40,20,40,20,BLACK);
+             break;
+          case 5:
+            display.FullScreenBMP(pic);
+            wait(1);            
+            break;
+          case 6:
+            display.PutString(3,2,"I can has mbed too");
+            display.PrintFloat(123.23,4,5);
+            display.PrintInteger(3,5,7);
+             break;
+
+         default: break;
+     }
+ }
diff -r 000000000000 -r 13c4589302f6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jan 04 18:37:11 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e