Pages: [1]   Go Down
Author Topic: Reading interval between button presses.  (Read 380 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 126
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: