Simple stopwatch with LCD

Dependencies:   TextLCD mbed

Revision:
0:dad37b1aabc1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jan 23 18:48:52 2011 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, e, d0-d3
+Serial pc(USBTX, USBRX); // tx, rx
+Timer t;
+
+int k=0;
+int c;
+int main()
+ {
+
+    while(1)
+    {
+     char c = pc.getc();
+        if((c == 'u') && k==0)
+        {
+            lcd.cls();
+            t.start();
+            lcd. printf("Hello\n");
+            k=1;
+        }
+        if((c == 'd') &&  k==1) 
+        {
+            t.stop();
+            lcd.printf(" %f sec\n", t.read());
+            k=0;
+            t.reset();
+         }
+     } 
+       
+}