Configurable countdown timer

Dependencies:   mbed PinDetect TextLCD

Files at this revision

API Documentation at this revision

Comitter:
MarceloSalazar
Date:
Sun May 24 23:02:30 2020 +0000
Parent:
0:95d8c08cb5d4
Child:
2:ecbc6a14824c
Commit message:
First version count up on LCD

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun May 24 23:02:30 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
--- a/main.cpp	Sun May 24 22:08:33 2020 +0000
+++ b/main.cpp	Sun May 24 23:02:30 2020 +0000
@@ -1,12 +1,38 @@
 #include "mbed.h"
- 
+#include "TextLCD.h"
+
 DigitalOut myled(LED1);
+
+//TextLCD(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, LCDType type = LCD16x2);
+// Note: VCC=5V, V0=0V, via 330 resistor)
+TextLCD lcd(p15, p16, p17, p18, p19, p20);
+
+DigitalOut VO(p21); // pin put low
+DigitalOut RW(p22); // pin put low
+
+int i = 0;
  
-int main() {
+void count() {
+    lcd.locate (0,1);
+    lcd.printf("%d",i);
+    i++;
+}
+ 
+int main () {
+
+    VO = 0;
+    RW = 0;
+    
+    // Clean screen
+    lcd.cls();
+    
+    lcd.printf("Hello World!");
+
     while(1) {
         myled = 1;
-        wait(0.2);
+        wait(0.5);
         myled = 0;
-        wait(0.2);
-    }
+        wait(0.5);
+        count(); 
+   }
 }
\ No newline at end of file