user8242: I'm having a soft pot meter here and I would like to register the duration of the touch event. I'm having a different variable, which keeps going from 1024 to 0 , which regularly takes 60 seconds, but for every second you touch the soft pot meter the count adds 50 up to 1024. Like returning the clock backward. 
How would I register/code this?


user10094: You have to go with timer interrupts. Here is the documentation: http://playground.arduino.cc/code/timer1
Roughly, when you detect a press, an interrupt is raised and the same thing goes for releasing. Using the timer values from both these events, you can accurately measure the time that the press lasted.

8242: <p>I'm having a soft pot meter here and I would like to register the duration of the touch event. I'm having a different variable, which keeps going from 1024 to 0 , which regularly takes 60 seconds, but for every second you touch the soft pot meter the count adds 50 up to 1024. Like returning the clock backward. </p>

<p>How would I register/code this?</p>

<p><img src="https://i.stack.imgur.com/NtBgH.jpg" alt="Softpot meter"></p>
 10094: <p>You have to go with timer interrupts. Here is the documentation: <a href="http://playground.arduino.cc/code/timer1" rel="nofollow">http://playground.arduino.cc/code/timer1</a></p>

<p>Roughly, when you detect a press, an interrupt is raised and the same thing goes for releasing. Using the timer values from both these events, you can accurately measure the time that the press lasted.</p>
