Sonar Simples

Dependencies:   HCSR04aa mbed

Fork of SonarSimples by Aqueles Que Não Sabem O Que Fazem

Committer:
Edgar2016
Date:
Thu Sep 29 17:03:20 2016 +0000
Revision:
1:9f0f27bc5f52
Parent:
0:e2112f4ac360
Child:
3:09347b9e1264
Sonar

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Edgar2016 0:e2112f4ac360 1 #include "sonar.h"
Edgar2016 0:e2112f4ac360 2 #include "mbed.h"
Edgar2016 0:e2112f4ac360 3 #include "hcsr04.h"
Edgar2016 0:e2112f4ac360 4
Edgar2016 0:e2112f4ac360 5 Sonar::Sonar():
Edgar2016 1:9f0f27bc5f52 6 _HCSR04(Sonar::trigger, Sonar::echo){
Edgar2016 1:9f0f27bc5f52 7
Edgar2016 0:e2112f4ac360 8 }
Edgar2016 0:e2112f4ac360 9 float Sonar::lerDistancia(HCSR04 _HCSR04){
Edgar2016 1:9f0f27bc5f52 10 float distance = _HCSR04.distance();
Edgar2016 1:9f0f27bc5f52 11 return distance;
Edgar2016 1:9f0f27bc5f52 12 }
Edgar2016 1:9f0f27bc5f52 13