Peak Finding
This example finds the peak value of an analog sensor over time. It assumes the sensor is moving in a simple curve.
The program checks to see that the current value is above a given threshold, then checks to see if the value is greater than the previous value. If so, then it saves the current value as a peak. When the current value goes below the threshold again, it outputs the last peak value recorded.