Go Down

Topic: Using a timer (Read 513 times) previous topic - next topic



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.


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

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!

via Egeo 16
Torino, 10131