Go Down

Topic: How to calculate intervals and execute an action at the specified time? (Read 404 times) previous topic - next topic

kurtselva

Hi guys,

So what I want to do is to calculate specified intervals and then rotate a servo at the specified timing.

For eg, I have 3 inputs to choose from an LCD display: 2,3 and 4 where 2 gives an interval of 12hr, 3 gives 8hr and 4 gives 6hr.
So if the user inputs a timing of 12:00 and then chooses the input of 2, the servo would rotate at the specified timing of 12:00. 24:00 and so on.

I would like to know how to write the code of the part where the upon the input if chosen, the interval is determined and this interval is then used to add on to the timing inputted by the user.

Thanks.

Quick5pnt0

Have you taken a look at the servo library?
http://arduino.cc/en/Reference/ServoWrite

kurtselva

Yes. I have no issue making the servo rotate..

My issue is more on how to write the code to make the interval and to add it to the input time by the user..

UKHeliBob

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up