Rhomb.io demo program for HC-SR04 Ultrasonic sensor
Dependencies: HC_SR04_Ultrasonic_Library
Diff: main.cpp
- Revision:
- 2:521be417cc8a
- Parent:
- 1:4a5586eb1765
--- a/main.cpp Thu Dec 04 08:04:55 2014 +0000 +++ b/main.cpp Thu Apr 04 06:50:43 2019 +0000 @@ -1,3 +1,5 @@ +//Medidor de distancia ultrasonico. Trigger: IO3, Echo: IO4 + #include "mbed.h" #include "ultrasonic.h" @@ -7,7 +9,7 @@ printf("Distance changed to %dmm\r\n", distance); } -ultrasonic mu(D8, D9, .1, 1, &dist); //Set the trigger pin to D8 and the echo pin to D9 +ultrasonic mu(IO3, IO4, .1, 1, &dist); //Set the trigger pin to D8 and the echo pin to D9 //have updates every .1 seconds and a timeout after 1 //second, and call dist when the distance changes