xxx_Sonar-HC-SR04

Dependencies:   mbed HC-SR04

Files at this revision

API Documentation at this revision

Comitter:
itbusch
Date:
Wed Feb 23 19:20:31 2022 +0000
Parent:
0:b0a3597dffa9
Commit message:
xxx_Sonar-HC-SR04

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib 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 b0a3597dffa9 -r 1e73871289d7 main.cpp
--- a/main.cpp	Thu Feb 05 19:04:15 2015 +0000
+++ b/main.cpp	Wed Feb 23 19:20:31 2022 +0000
@@ -4,14 +4,13 @@
 DigitalOut myled(LED1);
 Serial pc(USBTX,USBRX);     
 
-HCSR04 sonar(A2, D12);
+HCSR04 sonar(D2, D4);  //Trigger, Echo
 
 int main() {
     printf("INICIO PROGRAMA\n");
     while(1) {
-        printf("Distancia detectada pelo sensor Frente %.2f cm \n", sonar.getCm()); 
-        wait_ms(1000);
-        printf("Distancia detectada pelo sensor Frente %.2f in \n", sonar.getIn()); 
+        printf("Distanz %.2f cm \n\r", sonar.getCm()); 
+        pc.printf("Distancia %.2f cm \n\r",sonar.getCm());
         wait_ms(1000);
     }
 }
\ No newline at end of file
diff -r b0a3597dffa9 -r 1e73871289d7 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Wed Feb 23 19:20:31 2022 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#b1796dedeb8accde1cbaecf136fab96895e23d81
diff -r b0a3597dffa9 -r 1e73871289d7 mbed.bld
--- a/mbed.bld	Thu Feb 05 19:04:15 2015 +0000
+++ b/mbed.bld	Wed Feb 23 19:20:31 2022 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file