I'm using an accelerometer to measure movement, mapping (0-100) and averaging the data fine. However, I'm looking to sense when the data goes from positive to negative. E.g. sensing when the X axis goes up from ...50,51,52 THEN stops and reverses (52,51,50...). How would I detect that that point when it reverses?