Timer

Dependencies:   mbed

Committer:
MDevolution
Date:
Mon Oct 31 10:33:28 2016 +0000
Revision:
0:040ccac2a796
Esercitazione5_3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MDevolution 0:040ccac2a796 1 /* Program Example 3: A simple Timer example, from mbed website.
MDevolution 0:040ccac2a796 2 Activate Tera Term terminal to test.
MDevolution 0:040ccac2a796 3 */
MDevolution 0:040ccac2a796 4 #include "mbed.h"
MDevolution 0:040ccac2a796 5 Timer t; // define Timer with name “tâ€
MDevolution 0:040ccac2a796 6 Serial pc(USBTX, USBRX);
MDevolution 0:040ccac2a796 7
MDevolution 0:040ccac2a796 8 int main(){
MDevolution 0:040ccac2a796 9 t.start(); //start the timer
MDevolution 0:040ccac2a796 10 pc.printf("Forza NAPOLI!\n\r");
MDevolution 0:040ccac2a796 11 t.stop(); //stop the timer
MDevolution 0:040ccac2a796 12 pc.printf("The time taken was %f seconds\n\r", t.read()); //print to pc
MDevolution 0:040ccac2a796 13 }