Daniel Garcia / Mbed 2 deprecated timer

Dependencies:   mbed

Revision:
0:39849589866c
diff -r 000000000000 -r 39849589866c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Sep 30 21:15:01 2018 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+
+Timer tiempo;
+Serial pc (USBTX,USBRX);
+DigitalIn BOTON (USER_BUTTON);
+
+
+int t=0;
+int main() {
+   while (1){
+   while (BOTON){}
+        
+   tiempo.start();
+   while (!BOTON){}
+   tiempo.stop();
+   t= tiempo.read_ms();
+   pc.printf("%d\n",t);
+   tiempo.reset();
+}}