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.
Fork of HCSR04 by
Diff: hcsr04.h
- Revision:
- 2:0acb6ade091c
- Parent:
- 0:fb0929f37ebe
- Child:
- 3:e6795cb9439c
diff -r 093521f56089 -r 0acb6ade091c hcsr04.h
--- a/hcsr04.h Sat Mar 30 17:32:04 2013 +0000
+++ b/hcsr04.h Sat Mar 30 18:41:34 2013 +0000
@@ -35,14 +35,16 @@
/** Create a DistMeasure object connected to the specified pin
* @param pin i/o pin to connect to
*/
- DistMeasure(PinName TrigPin,PinName EchoPin,unsigned int maxtime);
+ DistMeasure(PinName TrigPin,PinName EchoPin);
~DistMeasure();
/** Return the distance from obstacle in cm
* @param distance in cms and returns -1, in case of failure
*/
- unsigned int get_distance_cm(void);
+ unsigned int get_dist_cm(void);
+ unsigned int get_pulse_us(void);
+ void start_measurement(void );
void isr_rise(void);
void isr_fall(void);
void fall (void (*fptr)(void));
@@ -55,7 +57,6 @@
Timer pulsetime;
DigitalOut trigger;
InterruptIn echo;
- unsigned int timeout;
unsigned int pulsedur;
unsigned int distance;
};
