Sonar Simples

Dependencies:   HCSR04aa mbed

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

sonar.h

Committer:
Edgar2016
Date:
2016-09-30
Revision:
3:09347b9e1264
Parent:
1:9f0f27bc5f52

File content as of revision 3:09347b9e1264:

#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); //Método para ler distancia   
};
 
#endif