Pages: [1]   Go Down
Author Topic: Using a timer  (Read 426 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I want to implement a timer in my program.
For example,
If I turn on a led and x seconds after it turns off(with the help of a switch for example), I want the Arduino to know the time it took from ON to OFF.
I looked at some functions like Micros, but they mention that Micros "Returns the number of microseconds since the Arduino board began running the current program".
Difference is I don't want to know the time since the Arduino started running the program but when I've pressed the switch to turn ON the LED and again to turn OFF the LED.

Thanks for your help.

Georgia, US
Offline Offline
Sr. Member
Karma: 5
Posts: 371
Arduino makes my head hurt :(
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the Blink Without Delay sample (under Digital), it'll get you started in the right direction

Pages: [1]   Go Up
Jump to: