It may be that the forum has mangled this code because it doesn't have any CODE TAGS, but what did you intend that bit of code to do?
Also, watch those limited erase/write cycles for the EPROM.
From what I've read, a spot in EEPROM holds up to 8 bits, so up to 255. The analog to digital converter uses 10 bits, so 1024.
Since the number of combinations is 255 I multiply by 4 to get the value back up in the 1024 range. Does that make sense?
My goal is to take the difference of the previous location( before the value changed) with the current position value.
So i take the difference of my storedValue*4 - setpointValue = diff.
If my setpoint value is larger than my storedValue then there is a negative number.
Taking the absolute value should eliminate this possibility.