Vejam ai essa merda
Dependencies: HC_SR04_Ultrasonic_Library mbed
Diff: sonar.cpp
- Revision:
- 0:498cbd4c79e9
diff -r 000000000000 -r 498cbd4c79e9 sonar.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sonar.cpp Wed Sep 21 18:43:01 2016 +0000 @@ -0,0 +1,16 @@ +#include "sonar.h" +#include "mbed.h" +#include "ultrasonic.h" + +Sonar::Sonar(): +_ultrasonic(Sonar::trigger, Sonar::echo, Sonar::updateTime, Sonar::timeout) +{ + + +} +float Sonar::lerDistancia(ultrasonic _ultrasonic){ + + float distancia = _ultrasonic.getCurrentDistance(); + return distancia; + +}