Go Down

Topic: How to perform a task for a specific time duration  (Read 182 times) previous topic - next topic

baron989

HI
Is there a library of code function that can allow me to do a specific task for a given time period. For example, I want to do the sweep function in a servo motor for only 30 seconds, then wait 1 minutes, and then resume the sweep function for 30 seconds

PaulS

Quote
Is there a library of code function that can allow me to do a specific task for a given time period.
There isn't a library needed for such a simple task.

Think about how you would perform the task. You have a pencil and paper (some variables) and a watch. You need to make the servo move for 30 seconds. What are some of the steps that you need to perform?

When you can define that list, the blink without delay example gives some clues how to make the Arduino do the list of things you have come up with.

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!

Arduino
via Egeo 16
Torino, 10131
Italy