Original Code Repo: https://os.mbed.com/users/priyank12p/code/Electronically-Connected-Intelligent-She/ Modified for Fall 2021 students.
Dependencies: mbed mbed-http ESP8266
Diff: hcsr04.h
- Revision:
- 2:0acb6ade091c
- Parent:
- 0:fb0929f37ebe
- Child:
- 3:e6795cb9439c
--- 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;
};