I made my version of your pseydocode in real code but i havent test it yet.
Here is the code tell me if there is any mistake.
int curTime = millis(); //current time
int servoTimer = 0;
int servoRunTime = 5000; //5000 ms
int buttonval = LOW;//current button state
int buttonPin = 0;//button input pin
int servoPin1 = 3;//servo 1 output pin for pulses
int servoPin2 = 4;//servo 2 output pin for pulses
void setup() {
pinMode(servoPin1,OUTPUT);//declaring servo pin 1 as an output
pinMode(servoPin2,OUTPUT);//declaring servo pin 2 as an output
pinMode(buttonPin,INPUT);//declaring button pin as an input
}
void loop
{
buttonval = digitalRead(buttonPin);
if (buttonval == HIGH ) {
servoTimer = curTime;
}
if ( curTime < servoTimer + servoRunTime ) {
digitalWrite(ServoPin1,HIGH);//running servo 1
delayMicroseconds(1000);
digitalWrite(ServoPin2,HIGH);//running servo 2
delay(20);
}
int curTime = 0
}
I removed the curTime ++; because i can get the time the arduino is running from the function millis();.
Your idea with the button is pretty good but i cant use a button to make my robot move so i will do it with a led and
with checking its state.