Sonar Simples
Dependencies: HCSR04
Diff: main.cpp
- Revision:
- 0:e2112f4ac360
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 29 16:49:08 2016 +0000 @@ -0,0 +1,13 @@ +/**main.cpp +#include "mbed.h" +#include "hcsr04.h" +//D12 TRIGGER D11 ECHO + HCSR04 sensor(D12, D11); +int main() { + while(1) { + long distance = sensor.distance(); + printf("distanza %d \n",distance); + wait(1.0); // 1 sec + } +} +*/