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.
Diff: main.cpp
- Revision:
- 8:25138f7b9309
- Child:
- 9:e703afddc87e
diff -r 71da0dbf4400 -r 25138f7b9309 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jan 13 14:48:25 2017 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "hcsr04.h"
+
+
+DigitalOut myled(LED1);
+HCSR04 usensor(D8,D9);
+unsigned int dist;
+int main()
+{
+
+ while(1) {
+ usensor.start();
+ wait_ms(500);
+ dist=usensor.get_dist_cm();
+ printf("\n\r cm:%ld",dist );
+
+ }
+}
\ No newline at end of file