Oliver Broad / Mbed 2 deprecated LCD_nonblocking_demo

Dependencies:   mbed

Fork of LCD_nonblocking_demo by Oliver Broad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Hello World! for the TextLCD
00002 /*
00003  * Heavily modified LCD "Hello world"
00004  *
00005  * LCD Library has been merged into program for convenience of development, and
00006  * can be de-merged once its looking reliable
00007  * currently this gives good results with a small LCD and with a LCD emulation VFD
00008  * but is not reliable with a GU140x32-7806A graphic VFD
00009  *
00010  * Note E is set to 1 at end of cycle in an attempt to force a bug as display works fine
00011  * on first power-up but tends to corrupt after MBED manual reset. I am speculating that
00012  * something appears on MBED pins that the display "objects" to during a manual reset
00013  *
00014  */
00015 
00016 #include "LCD_nonblocking.h"
00017 DigitalOut Led1(LED1);
00018 DigitalOut Led2(LED2);
00019 DigitalOut Led3(LED3);
00020 DigitalOut Led4(LED4);
00021 
00022 
00023 TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD20x4); // rs, e, d4-d7
00024 
00025 
00026 int main()
00027 {
00028     while(1) {
00029         Led1=1;
00030         lcd.init();
00031         Led2=1;
00032         Led1=0;
00033         while (lcd.busy) {}
00034         Led3=1;
00035         Led2=0;
00036         lcd.printf("Test String that goes over end of line!\n");
00037         Led4=1;
00038         Led3=0;
00039         while (lcd.busy) {}
00040         Led1=1;
00041         wait(1);
00042         // DigitalOut E(p17);
00043         // E=1; // try to break it
00044     }
00045 }