Pretty new to Arduino and coding here.
I have my Arduino Duemilanove connected to a servo motor and it works fine.
Ive uploaded the Sweep Sketch into it, tweaked it around to have the motor sweep from 0 degrees to 30 and back with a 10ms delay for each sweep.
My question is, can the arduino be coded to have the servo motor do the same movement that I have now, but only for 10minutes of every hour?
Is this action even possible.
code:
// Sweep
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 30; pos += 1) // goes from 0 degrees to 30 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 15ms for the servo to reach the position
}
for(pos = 30; pos>=1; pos-=1) // goes from 30 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 15ms for the servo to reach the position
}
}