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: mbed rohm-bh1790glc-driver mbed-http FXAS21000 FXOS8700Q ESP8266 RegisterWriter
Diff: hcsr04.h
- Revision:
- 4:33938a97d904
- Parent:
- 3:e6795cb9439c
- Child:
- 6:4be4fcd0c171
--- a/hcsr04.h Sat Mar 30 18:43:21 2013 +0000
+++ b/hcsr04.h Sat Mar 30 18:46:01 2013 +0000
@@ -41,15 +41,19 @@
/** Return the distance from obstacle in cm
* @param distance in cms and returns -1, in case of failure
*/
-
unsigned int get_dist_cm(void);
+ /** Return the pulse duration equal to sonic waves travelling to obstacle and back to receiver.
+ * @param pulse duration in microseconds.
+ */
unsigned int get_pulse_us(void);
+ /** Generates the trigger pulse of 10us on the trigger PIN.
+ */
void start(void );
void isr_rise(void);
void isr_fall(void);
void fall (void (*fptr)(void));
void rise (void (*fptr)(void));
-
+
private:
@@ -58,7 +62,7 @@
DigitalOut trigger;
InterruptIn echo;
unsigned int pulsedur;
- unsigned int distance;
+ unsigned int distance;
};
#endif
\ No newline at end of file