timer reference. on 1114-mbed

Dependencies:   mbed

Revision:
0:2a4387a90647
Child:
1:57ee27a9df19
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 14:02:25 2015 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+Timer TSGtimer;
+ 
+DigitalIn TSG(dp17,PullUp);
+DigitalOut DLEDG(dp14,0);
+Serial pc(USBTX, USBRX);
+ 
+int hoges,hogee;
+int main() {
+pc.baud(115200);
+while(1) {
+ 
+DLEDG = !TSG;
+if ( TSG == 1 && 0 != TSGtimer.read_ms()){
+TSGtimer.reset();
+TSGtimer.stop();
+}
+else if ( TSG == 0){
+TSGtimer.start();
+hogee=TSGtimer.read_ms();
+printf("\033[4;1H");
+printf("\033[K");
+printf("TSG-on times by msec %d\n", hogee);
+}
+}
+} 
\ No newline at end of file