Demo of LCD modified to use interrupts not delays.

Dependencies:   mbed

Fork of LCD_nonblocking_demo by Oliver Broad

This is an experiment in controlling an LCD from callbacks independently of the main program loop. As it runs from callbacks it is necessary to check if the library is "busy", which is currently indicated by an integer called "busy".

Busy checking should be converted into a method so that the criteria for being "busy" can be changed without changing the API.

As this is rough I have not issued it as a library ... yet.

Also due to my inexperience using the repository manager this is currently listed as a fork of itself. Sorry.

Files at this revision

API Documentation at this revision

Comitter:
oliverb
Date:
Mon Nov 18 13:58:53 2013 +0000
Parent:
0:e1231949753e
Child:
2:d87266912897
Commit message:
This is a very "rough and ready" attempt at a buffered LCD driver, currently it should be able to initialise and write characters without obstructing main program flow. Buffer is 40 characters, non-circular.;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Nov 18 13:49:59 2013 +0000
+++ b/main.cpp	Mon Nov 18 13:58:53 2013 +0000
@@ -222,11 +222,7 @@
 {
     writeCommand(0x01); // cls, and set cursor to 0
                        // This command takes 1.64 ms
-    timer.attach(this,&TextLCD::init9,0.00164);
-}
-void TextLCD::init9()
-{
-    busy=0;
+    timer.attach(this,&TextLCD::callback,0.00164);
 }
 
 void TextLCD::character(int column, int row, int c) {
@@ -380,7 +376,7 @@
     lcd.init();
     Led2=1;
     Led1=0;
-    while (lcd.busy) {}
+  //  while (lcd.busy) {}
     Led3=1;
     Led2=0;
     lcd.printf("Hello World!\n");