![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Sonar
Dependencies: mbed SDHC_FileSystem DS18B20_1wire HC_SR04_Ultrasonic_Library
Revision 0:a449396d32de, committed 2016-09-22
- Comitter:
- igorsilvati
- Date:
- Thu Sep 22 16:18:36 2016 +0000
- Commit message:
- Pega ai
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ModuloSD/SDHC_FileSystem.lib Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/tylerjw/code/SDHC_FileSystem/#b553aa902f90
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ModuloSD/cartaoSD.cpp Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,2 @@ +#include "cartaoSD.h" +#include "mbed.h" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ModuloSD/cartaoSD.h Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,27 @@ +#ifndef cartaoSD_H +#define cartaoSD_H + +#include "mbed.h" +#include "SDHCFileSystem" + +class cartaoSD{ + + const + + + + + SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name); + public: + + + + + + + + + + }; + +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SensorTemperatura/DS18B20_1wire.lib Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/richardlane/code/DS18B20_1wire/#00972ed59ba3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SensorTemperatura/Temperatura.cpp Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,2 @@ +#include "Temperatura.h" +#include "mbed.h" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SensorTemperatura/Temperatura.h Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,23 @@ +#ifndef Temperatura_H +#define Temperatura_H + +#include "mbed.h" + + + + + + + + + + + + + + + + + + +#endif \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sonar/HC_SR04_Ultrasonic_Library.lib Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/ejteb/code/HC_SR04_Ultrasonic_Library/#e0f9c9fb4cf3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sonar/sonar.cpp Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,17 @@ +#include "sonar.h" +#include "mbed.h" +#include "ultrasonic.h" + +Sonar::Sonar(): +_ultrasonic(Sonar::trigger, Sonar::echo, Sonar::updateTime, Sonar::timeout) +{ + + +} + +float Sonar::lerDistancia(ultrasonic _ultrasonic){ + + float distancia = _ultrasonic.getCurrentDistance(); + return distancia; + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sonar/sonar.h Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,26 @@ +#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 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,14 @@ +#include "mbed.h" + +DigitalOut gpo(D0); +DigitalOut led(LED_RED); + + +int main() +{ + while (true) { + gpo = !gpo; // toggle pin + led = !led; // toggle led + wait(0.2f); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Sep 22 16:18:36 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file