1

I am counting rotations of a shaft and timing events that occur during that rotation. I wish to display the event timing as a percentage of ~1/4 of the rotation timing. This would involve recording the rotation time, dividing that number by 3.6 and dividing that number by the value of the event timer, then displaying that percentage on an LCD array.

  • 2
    I don't really understand, what you are trying to do. I also don't understand, what exactly your problem is with writing the code. For normal timing the millis() and micros() function can be used, which give you the time since startup in milliseconds or microseconds respectively – chrisl Jul 26 at 19:38
  • your last sentence is a rough outline of the program function ... This would involve recording the rotation time, dividing that number by 3.6 and dividing that number by the value of the event timer, then displaying that percentage on an LCD array. .... add much, much more detail ... basically, turn it into a flow chart that you can convert into code – jsotola Jul 26 at 20:07
  • 1
    Welcome to SE/Arduino! Please take the tour and read "How to Ask". Please also note, that these sites are neither services to get a program written nor teaching in depth. Show us some code, describe the specific problem and post a detailled question. As your question is now, the answer is simply "yes." – the busybee Jul 27 at 6:41
1

What you are looking for is the millis() function. It returns the time that passed in milliseconds since the board power up.

With this function you can find the time delta, and achieve all the described calculations.

For more information

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.