![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Based on the NewTextLib, I made a modification for using this lib on the Elmicro Testbed with display GDM2004D
Diff: main.cpp
- Revision:
- 0:9c69fa6c1120
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jun 11 20:34:14 2011 +0000 @@ -0,0 +1,54 @@ +// Hello World! for the TextLCD with Elmicro Testbed LCD display GDM2004D +// With modified NewTextLCD library + +#include "mbed.h" +#include "NewTextLCD.h" + +DigitalOut myled(LED1); //for blinking purposes +AnalogIn Potm(p15); //var. resistor +TextLCD lcd(p26, p25, p24, p23, p22, p20, p19, TextLCD::LCD20x4); // rs, rw, e, d4-d7 + +float delay_time = 1.0; + +int main() { + lcd.printf("Hello mbed\n"); + //define user chars + int pattern[8]; + int pattern1[8]; + pattern[0] = 1; // * + pattern[1] = 3; // ** + pattern[2] = 5; // * * + pattern[3] = 9; // * * + pattern[4] = 0x11; // * * + pattern[5] = 0x19; // ** * + pattern[6] = 0x1d; // *** * + pattern[7] = 0x1f; // ***** + + pattern1[0] = 0x10; // * + pattern1[1] = 0x18; // ** + pattern1[2] = 0x14; // * * + pattern1[3] = 0x12; // * * + pattern1[4] = 0x11; // * * + pattern1[5] = 0x13; // * ** + pattern1[6] = 0x17; // * *** + pattern1[7] = 0x1f; // ***** + + lcd.writeCGRAM(0, pattern); + lcd.writeCGRAM(1, pattern1); + + lcd.locate(15,0); + lcd.putc(0); // user pattern 0 + lcd.putc(1); // user pattern 1 + lcd.locate(0,1); + lcd.printf("Hello World!\n"); + while(1) + { + delay_time = Potm.read(); + myled = 1; + wait(delay_time); + myled = 0; + wait(delay_time); + lcd.locate(0,2); + lcd.printf("Value: %1.2f", delay_time); + } +}