How to save a constant updating value

treahuggs:
The code i posted did (with respect to needing the rest of course)

No, it did not compile. There is absolutely no way that this would compile:
if ((val==HIGH){

treahuggs:
Goal- My goal with this project is a auto shut off blinker for a motorcycle. I will read the angle of the bike at all times.

Well, saving the current angle and comparing against that is easy enough and I'm sure we can fix your sketch to do that correctly. However, I'm afraid that you will find that on a moving bike your method of reading the lean angle using an accelerometer will not work. Ignoring the small transient forces needed to accelerate the bike in roll and yaw, the net acceleration is always in a plane define by the two contact patches and the center of mass. If you have conventional tyres the contact patch does not move significantly relative the rest of the bike and all your accelerometer will see is that the acceleration remains on the center line of the bike.

I think you might have more luck deriving the turn radius from the average steering angle over a short interval, although I think it'll be difficult to get a reliable detection of the bike coming out of a turn at high speed because the steering angles will be so low. Perhaps, if you know the bike is moving fast enough to make turn detection difficult, you could simply cancel the indicators after a set time on the basis that at high speed you rarely need to signal for longer than a few seconds.