Infant Respiratory Monitor Flex Sensor

Here's what popped into my head. Someone probably has a better idea.

I would establish a distinct sampling interval, say 1 second. This would give twenty samples every twenty seconds. To hold sampled values I'd declare an array. Right before each sample I'd discard the oldest sample and shift all the array's values over one. Now you have samples twenty seconds apart to compare and all the samples in between. Basically the first and last items in the array are twenty seconds apart. You could change the sampling rate and array size if needed.

Make sense? You'll need to understand blink without delay and arrays.