Q

Dependents:   PROJ515_USS_GPS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SRF05.h Source File

SRF05.h

00001 #ifndef __SRF05_H__   //Inclusion safeguards
00002 #define __SRF05_H__   //Definition of the inclusion
00003 /*============================================================================*/
00004 
00005 /* Libraries */
00006 #include "mbed.h"                   // Mbed RTOS
00007 
00008 /* Classes */
00009 class SRF05
00010 {
00011     public:
00012     SRF05(PinName TrigPin,PinName EchoPin);
00013     float get_dist(void);
00014     void start(void);
00015     
00016     private:
00017     DigitalOut   trigger;
00018     InterruptIn  echo;
00019     Timer        pulsetime;
00020     unsigned int pulsedur;
00021     float        distance;
00022     void isr_rise(void);
00023     void isr_fall(void);
00024 };
00025 
00026 /*============================================================================*/
00027 #endif // End of inclusion