adc compartor delay and save to memory

am not really good in programming here that much

Sorry you are not much good at explaining what you want to do either. Probably English is not your first language but it is hard to understand what you want to do and even harder to understand why you want to do it. Also please use the hash key to post code.

So let me get this straight:-

  1. Measure the value from a pot.
  2. Compare it to what it was - this doesn't make sense as it never was anything the first time round - do what with the result of this comparison?
  3. Do some sort of delay.
  4. Measure it again and if it is the same as last time - then what. You say store it in memory but it is in memory already in the form of a variable.

If we know what you want to do and possibly why then we might be of some help.