Timer for 75 seconds?

Hello guys, I am trying to move a servo once every 75 seconds. For some reason I am unable to do this, instead of waiting 75 seconds, the servo waits 11 seconds( I timed it) and then moves. is there any limit to the value in “delay”? in my code I simply put delay 75000, which should equal 75 seconds. I used 75000 as a variable, because I didn’t feel like manually changing the delay value for everything every time I wanted a different value. I admit i’ve never made a timer for this long before, but am I doing something wrong? do I need to do something different if it’s above a minute delay?

what am I doing wrong here? Any help would be greatly appreciated.

#include <Servo.h>
 
Servo servo_0; //define servo
int x = 75000;

void setup() 
{ 
  servo_0.attach(0);  // attaches the servo on pin 0 to the servo object
  servo_0.write(90); // starting position
  delay(1000);
}
void loop() 
{
  
//Individual Servo Control
 
  servo_0.write(0);  //first movement to 0 degrees
  delay(x);
  servo_0.write(15);  //first movement to 15 degrees
  delay(x);
  servo_0.write(30);  //second movement to 30 degrees
  delay(x);
  servo_0.write(45);  //third movement to 45 degrees
  delay(x);
  servo_0.write(60);  //first movement to 60 degrees
  delay(x);
  servo_0.write(75);  //second movement to 75 degrees
  delay(x);
  servo_0.write(90);  //third movement to 90 degrees
  delay(x);
  servo_0.write(105);  //first movement to 105 degrees
  delay(x);
  servo_0.write(120);  //second movement to 120 degrees
  delay(x);
  servo_0.write(135);  //third movement to 135 degrees
  delay(x);
  servo_0.write(150);  //first movement to 150 degrees
  delay(x);
  servo_0.write(165);  //second movement to 165 degrees
  delay(x);
  servo_0.write(180);  //third movement to 180 degrees
  delay(x);
   servo_0.write(165);  //first movement to 165 degrees
  delay(x);
  servo_0.write(150);  //second movement to 150 degrees
  delay(x);
  servo_0.write(135);  //third movement to 135 degrees
  delay(x);
  servo_0.write(120);  //first movement to 120 degrees
  delay(x);
  servo_0.write(105);  //second movement to 105 degrees
  delay(x);
  servo_0.write(90);  //third movement to 90 degrees
  delay(x);
  servo_0.write(75);  //first movement to 75 degrees
  delay(x);
  servo_0.write(60);  //second movement to 60 degrees
  delay(x);
  servo_0.write(45);  //third movement to 45 degrees
  delay(x);
  servo_0.write(30);  //first movement to 30 degrees
  delay(x);
  servo_0.write(15);  //second movement to 15 degrees
  delay(x);
  servo_0.write(0);  //second movement to 0 degrees
  delay(x);
  
 }

75000 stored into an int resulting in 11 seconds, that sounds about right (its actually 9.465 seconds or 9 as an int).

int x = 75000;

Perhaps you should look at the Arduino reference page for an int and see what its range is.

wow @_@ that was stupid of me. I rarely use int() so I guess I just thought it meant a variable. But the value in int(75000) doesn't equal 75000.

But the value in int(75000) doesn't equal 75000.

Correct, 75000 in binary is 00000001 00100100 11111000, and an int is only a two byte variable. With that said if you take off the 00000001 from the above value, you are left with 00100100 11111000 which equals 9464 in decimal, or 9.464 seconds for a timer in milliseconds.

Instead of int, change it to long.

Get rid of all the delay()s in your program and use millis() to manage the timing as illustrated in the demo several things at a time

Note that all variables connected with millis() must be defined as unsigned long.

...R