need help with a millisec timer ??

hi there …
im working in some sort of protection system and i need to build a millisec timer that start counting with an input signal and also stop with another input signal , also it must catch the last reading of time when the stop signal arrive (latching) then show it on 7segments or lcd .

Its built in to the Adruino - just look up " Millis "

What have you tried.

It's basically very simple (if you know how :slight_smile: ).

Use a variable to store the start time (use millis()) when the start signal comes in. Use a second variable to store the end time (again use millis()) when the stop signal arrives.

For remembering any of the values, either use global variables or static local variables.

What kind of signals are you talking about? Push buttons or signals from external equipment? If external equipment, what?

What have you tried? Show us your code and we show you ours :wink:

Please post code using code tags.
Type
** **[code]** **

Paste your code after that
Type
** **[/code]** **
after that

firstly thanx for you guys for replying me ...
about the kind of signal its an analog signal (voltage) that comes from the system when the protection device sensing the fault .
basically i didnt write any code yet so that im asking for your help guys coz i just know basic things about arduino programming ...
regards

(deleted)

Then feel free the write some code and come back. If you want someone to tutor you or write the code, bring your wallet with you.

Thanx a lot dude ...

(deleted)

What is the analog signal that you're talking about? Just 0 and 5V (or 12V) or a sine wave or ...

In your opening post you were talking about two input signals. With you mentioning 'analog', are those indeed two signals (coming from different sources or one signal with different levels or ...

nazar89:
Thanx a lot dude ...

Please slow down a bit. We are here to help with problems and do that for free; but you have to put some effort in.

If you're not prepared to put effort in, why would we? You will have to learn and you will need to maintain whatever code you write. So start with something, it's likely not to work so post it here and we will point out the mistakes (and try to explain why they are mistakes).

ok guys i really appreciate your words and im sorry if someone annoyed from me
i will try to write some codes then we will see what to do .
thanks again

When you get back to us, please try to answer the questions that were asked as well :wink: