Need Servo Help!

Hi guys,

I’m using a GWS mini servo and have the desired goal of turning is 90 degrees then pausing for 24 hours.

The current code i have turns it 90 degrees then detaches the pin.

Any idea on how i can achieve my goal?

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards

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 <= 90; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position



How accurate does the "24 hours" have to be and what is supposed to happen at the end of it?

Note that if you detach the servo it will not maintain its position if there is any load on it.


Sounds like a task for a simple state machine.