Go Down

Topic: Reading interval between button presses. (Read 610 times) previous topic - next topic

Sturds

Hello I am looking to make and sketch that will measure the time inverval between two button presses. Is there already something similar to this or could someone please point me in the right direction?

sdturner

Use the function millis(). Subtract the first from the last and you have the number of milliseconds between events. There is a stopwatch example in the playground.

http://arduino.cc/playground/Code/Stopwatch

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy