my version

Fork of HCSR04 by Awadh Al Shukaili

Revision:
1:62f97e90a58c
Parent:
0:0bda99bb39a4
--- a/HCSR04.cpp	Tue Oct 18 14:32:12 2011 +0000
+++ b/HCSR04.cpp	Sat Nov 18 18:27:18 2017 +0000
@@ -10,7 +10,7 @@
 // 
 
 //return echo duration in us (refer to digram above)
-long HCSR04::echo_duration() {
+float HCSR04::echo_duration() {
     timer.reset();
     trig = 0;
     wait_us(2);
@@ -27,7 +27,7 @@
 //return distance to nearest obstacle or returns -1 
 //if no obstacle within range
 //set sys to cm or inch accordingly
-long HCSR04::distance(int sys){
+float HCSR04::distance(int sys){
     duration = echo_duration();
     if(duration > 30000)
         return -1;