HCSR04.h made by Prabhu Desai.

Dependencies:   mbed HCSR04

cm表示にしたい場合は、hcsr04.cppのdistanceの値を、 (pulsedur*343)/20000 にする。 mm表示にしたい場合は、 (pulsedur*3430)/20000 にする。

Files at this revision

API Documentation at this revision

Comitter:
piroro4560
Date:
Tue Apr 02 04:52:30 2019 +0000
Parent:
1:04ad69a98f3b
Commit message:
US_sensor;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 04ad69a98f3b -r 82bf761db1eb main.cpp
--- a/main.cpp	Sat Mar 30 10:47:40 2019 +0000
+++ b/main.cpp	Tue Apr 02 04:52:30 2019 +0000
@@ -11,10 +11,8 @@
     pc.printf("Start!\n\r");
     while(1) {
         usensor.start();
-        wait_ms(500);
         unsigned int dist = usensor.get_dist_cm();
         pc.printf("cm:%ld\r\n",dist );
         myled = !myled;
-        wait(1);
     }
 }
\ No newline at end of file