Sonar Simples
Dependencies: HCSR04
Diff: sonar.h
- Revision:
- 0:e2112f4ac360
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sonar.h Thu Sep 29 16:49:08 2016 +0000 @@ -0,0 +1,23 @@ +#ifndef Sonar_H +#define Sonar_H + +#include "mbed.h" +#include "hcsr04.h" + +class Sonar +{ + static const PinName trigger = D1; //Define o pino para o trigger + static const PinName echo = D0; //Define o pino para o echo + + //Inicializa o sensor nos pinos definidos acima + HCSR04 _HCSR04; + +public: + Sonar(); + ~Sonar(); + float lerDistancia(HCSR04 _HCSR04); + + +}; + +#endif \ No newline at end of file