A sample program for custom character in lcd
Fork of mbed_lcd_custom by
Revision 0:310523b6696e, committed 2014-07-03
- 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
--- /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