treahuggs:
So i decided to use the accelerometer. They say its accurate up to 45 degrees and its easy to code.
To repeat - using an accelerometer to detect the lean angle on a bike is futile.
I'd also question your logic of waiting for the lean angle to return past the initial 'set point' established when the signal was started. You should expect the signal to start before the turn not during it and you may even be leaning in the opposite direction to the turn signal.
PaulS's suggested approach of using canceling the signal after an interval derived from the road speed is much simpler to implement and likely to work well from the rider's point of view. Solutions based on the steering position should be feasible but will be harder to get working well. Solutions based on accelerometer sensing of lean angles are not feasible.