Smartage application

Dependencies:   BufferedSerial SX1276GenericLib USBDeviceHT mbed Crypto X_NUCLEO_IKS01A2

Fork of STM32L0_LoRa by Helmut Tschemernjak

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hcsr04.h Source File

hcsr04.h

00001 #ifndef hcsr04_H
00002 #define hcsr04_H
00003 #include "mbed.h"
00004 
00005 
00006  
00007 class HCSR04 {
00008   public:
00009     HCSR04(PinName t, PinName e);
00010     long echo_duration();
00011     long distance();
00012  
00013     private:
00014         DigitalOut trig;
00015         DigitalIn echo;
00016         Timer timer;
00017         long duration,distance_cm;
00018 };
00019  
00020 #endif