AnalogRead peak detection (local maxima)

Typo alert :

delay(Delay)/2;

Also the logic as I read the program will return an unknown value if you get a rising value(or both same) below the threshold - no return value

Oh, wait, something familar here - I've seen a discussion on some similar software filter earlier on in this forum-site (in the "old" section). I'll see if I can find it.

(Edit: correct a typo :blush:)