春ロボ ロケット団 / Mbed 2 deprecated testultrasonic

Dependencies:   mbed hcsr04

Files at this revision

API Documentation at this revision

Comitter:
maxnagazumi
Date:
Mon Mar 02 10:54:23 2020 +0000
Commit message:
newone;

Changed in this revision

hcsr04.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r ee90d231a709 hcsr04.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hcsr04.lib	Mon Mar 02 10:54:23 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/ROBOSTEP_LIBRARY/code/hcsr04/#2aedff8578d2
diff -r 000000000000 -r ee90d231a709 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 02 10:54:23 2020 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include"hcsr04.h"
+
+HCSR04 echo_1(PC_0,PC_12);//A
+HCSR04 echo_2(PA_15,PB_7);//A
+HCSR04 echo_3(PH_1,PB_0);// B
+HCSR04 echo_4(PC_3,PB_10);//B 
+
+int main() {
+    
+    printf("100");
+    
+    double a=0,b=0,c=0,d=0;
+    while(1) {
+       echo_1.start();
+        echo_2.start();
+        echo_3.start();
+        echo_4.start();
+        wait(1);//minimum wait is 30msec 
+        a=echo_1.get_dist_cm();
+        b=echo_2.get_dist_cm();
+       c=echo_3.get_dist_cm();
+        d=echo_4.get_dist_cm();
+        printf("a:%lf b:%lf c:%lf d:%lf\r\n",a,b,c,d);
+    }
+}
+
+
diff -r 000000000000 -r ee90d231a709 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 02 10:54:23 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file