![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Vejam ai essa merda
Dependencies: HC_SR04_Ultrasonic_Library mbed
sonar.h
- Committer:
- Edgar2016
- Date:
- 2016-09-21
- Revision:
- 0:498cbd4c79e9
File content as of revision 0:498cbd4c79e9:
#ifndef Sonar_H #define Sonar_H #include "mbed.h" #include "ultrasonic.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 static const float updateTime = .1; static const float timeout = 1; //Inicializa o sensor nos pinos definidos acima ultrasonic _ultrasonic; public: Sonar(); ~Sonar(); float lerDistancia(ultrasonic _ultrasonic); protected: }; #endif