What’s the best routine to capture the peak value from an analog in pin?
I’m working on a gesture-based instrument, in specific, a glove with a 3-axis accelerometer on it. It’s obviously impossible to maintain some kind of constant acceleration with one’s hand, so instead I want to choose a note based on how fast I move my hand along an axis.
That means taking the maximum (or minimum) AIN-reading each time it passes a threshold, like some kind of track-and-hold.
Here’s my first prototype, with an accelerometer, flex sensor and finger contacts using conductive thread:
This is just for testing, unlike my 2nd prototype below which has a proper glove, smaller case and TQFP (!) SMD PIC18F: