Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Timer.cpp
- Revision:
- 0:1d3fd5616c0a
diff -r 000000000000 -r 1d3fd5616c0a Timer.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Timer.cpp Mon Jun 02 06:47:30 2014 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+DigitalIn btn(USER_BUTTON);
+Timer t;
+
+int main() {
+ while(true) {
+ while(btn != 0);
+ t.start();
+ while(btn != 1);
+ t.stop();
+ pc.printf("%i us\n", t.read_us());
+ t.reset();
+ }
+}
\ No newline at end of file