Sensore Ultrasuoni

Dependencies:   mbed HCSR04

Files at this revision

API Documentation at this revision

Comitter:
DonatoSt
Date:
Tue Dec 18 22:27:19 2018 +0000
Commit message:
sensore ultrasuoni

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 70789ba39324 HCSR04.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HCSR04.lib	Tue Dec 18 22:27:19 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/prabhuvd/code/HCSR04/#71da0dbf4400
diff -r 000000000000 -r 70789ba39324 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Dec 18 22:27:19 2018 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "hcsr04.h"
+
+ HCSR04 sensor (D15, D14);
+ Serial pc(USBTX, USBRX);
+ int main (){
+    pc.baud(9600);
+    while(1) {
+        sensor.start();
+        wait_ms(100);
+        pc.printf("%dcm\t", sensor.get_dist_cm());
+    }
+  
+}
+
diff -r 000000000000 -r 70789ba39324 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Dec 18 22:27:19 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file