Sonar distance reader example code
Fork of HC_SR04_Ultrasonic_Library by
Revision 5:1036bed14d50, committed 2018-10-16
- Comitter:
- kzar
- Date:
- Tue Oct 16 20:17:25 2018 +0000
- Parent:
- 4:e0f9c9fb4cf3
- Commit message:
- Sonar distance reader example code
Changed in this revision
| ultrasonic.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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);
}
