MB7040 Range finder experiment.
Dependencies: mbed
Fork of SonarRangeFinderV1 by
Diff: main.cpp
- Revision:
- 2:9870fda1edb6
- Parent:
- 1:0cf1f2254f10
--- 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; } }