Cameron Causer / HC_SR04_Ultrasonic_Library

Fork of HC_SR04_Ultrasonic_Library by EJ Teb

Revision:
5:1036bed14d50
Parent:
4:e0f9c9fb4cf3
diff -r e0f9c9fb4cf3 -r 1036bed14d50 ultrasonic.cpp
--- a/ultrasonic.cpp	Mon Nov 24 20:23:07 2014 +0000
+++ b/ultrasonic.cpp	Tue Oct 16 20:17:25 2018 +0000
@@ -27,7 +27,8 @@
     {
         end = _t.read_us ();
         done = 1;
-        _distance = (end - start)/6;       
+        //Consider scaling this using integer ops (?
+        _distance = (end - start)/148;       
         _tout.detach();
         _tout.attach(this,&ultrasonic::_startTrig, _updateSpeed);   
     }