+ result = true; // Successfully found an edge
+ // If the experiment has already been initialised
+ if( lastPosition > 0)
+ {
+ // Find the rate of expansion and convert to mm. Will give a negative result for compression.
+ *value = (average - lastPosition) * SCALE;
+ lastPosition = average; // Current position now becomes the last position
+ }