Simple stopwatch with LCD

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
christian
Date:
Sun Jan 23 18:48:52 2011 +0000
Commit message:

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun Jan 23 18:48:52 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
--- /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();
+         }
+     } 
+       
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jan 23 18:48:52 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e