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: FrontGet.h
- Revision:
- 1:8ebc0fbaa981
diff -r 84736ef4c7d4 -r 8ebc0fbaa981 FrontGet.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FrontGet.h Thu Oct 21 11:46:04 2021 +0000
@@ -0,0 +1,16 @@
+#include "us015.h"
+
+US015 hs(D2, D3);
+DigitalOut Ultra(D2);
+Serial pc(USBTX,USBRX);
+
+int FrontGet() {
+ Ultra = 1; //超音波on
+ hs.TrigerOut();
+ wait(1);
+ int distance;
+ distance = hs.GetDistance();
+ pc.printf("distance=%d\r\n", distance); //距離出力
+ Ultra=0;//超音波off
+ return distance;
+}
\ No newline at end of file