Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HC_SR04_Ultrasonic_Library mbed
sonar.h
00001 #ifndef Sonar_H 00002 #define Sonar_H 00003 00004 #include "mbed.h" 00005 #include "ultrasonic.h" 00006 00007 class Sonar 00008 { 00009 static const PinName trigger = D1; //Define o pino para o trigger 00010 static const PinName echo = D0; //Define o pino para o echo 00011 static const float updateTime = .1; 00012 static const float timeout = 1; 00013 00014 //Inicializa o sensor nos pinos definidos acima 00015 ultrasonic _ultrasonic; 00016 00017 public: 00018 Sonar(); 00019 ~Sonar(); 00020 float lerDistancia(ultrasonic _ultrasonic); 00021 00022 protected: 00023 00024 }; 00025 00026 #endif
Generated on Wed Jul 20 2022 03:00:09 by
1.7.2