A sample program for custom character in lcd

Dependencies:   TextLCD mbed

Fork of mbed_lcd_custom by The Electronics Nuke

Files at this revision

API Documentation at this revision

Comitter:
mbeded
Date:
Thu Jul 03 20:06:40 2014 +0000
Child:
1:e6f698c0d7af
Commit message:
Bello and tongue and hello

Changed in this revision

TextLCD.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu Jul 03 20:06:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbeded/code/TextLCD/#0a5271dd8a9c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 03 20:06:40 2014 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD di(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2);
+
+int cur = 0;
+int mov = 1;
+
+char smile[] = {0,0,10,0,17,14,0,0};
+char tongue[] = {0,0,10,0,17,14,2,0};
+char hello[] = {4,12,30,31,17,17,14,0};
+char comey[] = {0,0,30,31,21,17,14,0};
+
+int main() 
+{
+    di.createChar(0, smile);
+    di.createChar(1, hello);
+    di.createChar(2, comey);
+    di.createChar(7, tongue);
+    while(1)
+    {
+        di.cls();
+        di.setAddress(cur,0);
+        di.printf("BELLO");
+        di.setAddress(0,1);
+        di.putc(0);
+        di.setAddress(4,1);
+        di.putc(1);
+        cur = cur + mov;
+        if(cur >= 11 || cur <= 0)
+            mov = -mov;
+        wait(1);
+
+        di.cls();
+        di.setAddress(cur,0);
+        di.printf("BELLO");
+        di.setAddress(0,1);
+        di.putc(7);
+        di.setAddress(4,1);
+        di.putc(2);
+        wait(1);
+        cur = cur + mov;
+        if(cur >= 11 || cur <= 0)
+            mov = -mov;    
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jul 03 20:06:40 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file