
Measure correction with the two calibration points (10,5) and (25,10).
The code allowing you to program this calibration is very similar to the preceding code example.
Double
[]
ValuesBefore =
{
10
,
25
}
;
Double
[]
ValuesAfter =
{
5
,
10
}
;
YRangeFinder f = YRangeFinder.
FirstRangeFinder
()
;
f.
calibrateFromPoints
(
ValuesBefore, ValuesAfter
)
;
f.
get_module
()
.
saveToFlash
()
;
Note that the values before correction must be sorted in a strictly ascending order, otherwise they
are simply ignored.
3 to 5 point correction
3 to 5 point corrections are only a generalization of the 2 point method, allowing you to create up to 4
correction ranges for an increased precision. These ranges cannot be disjoint.
Correction example with 3 calibration points
Back to normal
To cancel the effect of a calibration on a function, call the
calibrateFromPoints()
method with two
empty arrays.
Double
[]
ValuesBefore =
{}
;
Double
[]
ValuesAfter =
{}
;
YRangeFinder f = YRangeFinder.
FirstRangeFinder
()
;
18. Advanced programming
122
www.yoctopuce.com
Summary of Contents for Yocto-RangeFinder
Page 1: ...Yocto RangeFinder User s guide...
Page 2: ......
Page 18: ...12 www yoctopuce com...
Page 26: ...20 www yoctopuce com...
Page 42: ...36 www yoctopuce com...
Page 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...
Page 90: ...84 www yoctopuce com...
Page 120: ...114 www yoctopuce com...
Page 130: ...124 www yoctopuce com...
Page 484: ...478 www yoctopuce com...
Page 488: ...482 www yoctopuce com...
Page 490: ...23 Characteristics 484 www yoctopuce com...
Page 491: ......
Page 492: ......