How to write into existing code a hands free start and stop function

Hello again, I would like to continue picking anyone's brain. Again my project includes an Arduino Uno, and a continuous rotation servo. I would like it to run for 30mins stop for 10mins then start up again. Below is the current code that I am using for my project. My question is how do I write in the function of starting and stopping completely hands free into my current code. Thanks for any advise..

#include <Servo.h>

Servo myservo;

void setup()
{
myservo.attach(9);
myservo.write(94); // set servo to mid-point
}

void loop() {}

Start with reading the stickies and using code tags!

Mark

what do you mean "for starting and stopping completely hands free"?

Your code includes no indication that a hand could influence it short of unplugging it or plugging it in...

"what do you mean "for starting and stopping completely hands free"?

Your code includes no indication that a hand could influence it short of unplugging it or plugging it in..."

That is correct currently the device just runs until I turn it off. What I would like is to initially turn the device on let it run for 30mins then it will automatically shut of for 10min then start up again for 30mins. Does that make any sense? I just don't know enough yet about how to write code for arduino.

Any help would be great.

Have a look at how millis() is used to manage timing in several things at a time.

Basically you need to record the value of millis() when your motor starts and then check to see if the required time has elapsed.

...R

Thank you for the link and the info. A quick question, and sorry if its a stupid one but...how do you record the value of millis()??

Write it to an appropriate variable.

AWOL:
Write it to an appropriate variable.

Thank you