超音波センサー動作確認

Dependencies:   mbed Ping

Files at this revision

API Documentation at this revision

Comitter:
tomoya123
Date:
Fri Mar 17 08:44:31 2017 +0000
Commit message:
ultrasonic

Changed in this revision

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
ping2.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Mar 17 08:44:31 2017 +0000
@@ -0,0 +1,18 @@
+ #include "mbed.h"
+ #include "Ping.h"
+ 
+ 
+ Ping Pinger(p30);
+ 
+ int main() {
+     float range;
+
+    
+     while(1) {
+        Pinger.Send();    
+        wait_ms(30);
+        range = Pinger.Read_cm()/2.0;
+        wait(1.0);
+        printf("%0.1f\r\n",range);
+     }
+ }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 17 08:44:31 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ping2.lib	Fri Mar 17 08:44:31 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/rosienej/code/Ping/#6996f66161d7