MB7040 Range finder experiment.
Dependencies: mbed
Fork of SonarRangeFinderV1 by
Revision 2:9870fda1edb6, committed 2015-03-01
- Comitter:
- gfmitch
- Date:
- Sun Mar 01 08:07:33 2015 +0000
- Parent:
- 1:0cf1f2254f10
- Commit message:
- Modified v1-1 to correctly handle range of values read by MB7040.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jan 03 22:40:31 2015 +0000 +++ b/main.cpp Sun Mar 01 08:07:33 2015 +0000 @@ -48,7 +48,12 @@ // Output voltage proportional to distance. // The output value for the variable signal is 0 to 1.0. - signal = range / 765.0; + signal = ( range - 20.0 ) / 745.0; + + // original code (below) did not account for the "dead" values + // 0-20cm + + // signal = range / 765.0; } }