Code for "Time-Lock switch"?

I have a variable pot hooked up to an analog input pin on an arduino uno that I have mapped out, controlling the delay time for a motor turning on and off. I'd like to add a "lock-in time value" switch to make that variable pot value temporarily become 'fixed' while switch is high, regardless of any variable pot changes.
Flipping the switch to low would return that delay variable back to whatever position the variable pot subsequently is in.

Forward Thanks,
Andrew K.

Presumably, you're using analogread to get the pot reading into a variable, which you use elsewhere in your code to control the motor. Put that anlogread inside an if statement that checks a digitalread of your switch, so you don't read it when the digitalread returns high.

cool...cool... thank you...

I still am not sure on how then to, while switch returns HIGH, have the loop refer to the then "fixed" delay time for the motorPin being HIGH.

here's relavent lines from my code:

const int motorPin = 3;
const int timeLockPin = 13;
const int analogIn1Pin = A0;

int sensorValue1 = 0;
int outputValue1 = 0;

void setup(){
pinMode(motorPin, OUTPUT);
pinMode(timeLockPin, INPUT);
pinMode(analogIn1Pin, INPUT);
}
void loop(){
sensorValue1 = analogRead(analogIn1Pin); // this is a 10 turn pot used to dial in
outputValue1 = map(sensorValue1, 0, 1023, 50, 11236); // milleseconds for the motor's "onTime"

digitalWrite(motorPin, HIGH);
delay(outputValue1);
digitalWrite(motorPin, LOW);
delay(1150);
}

so I should...

sensorValue1 = analogRead(analogIn1Pin);

if (digitalRead(timeLockPin) == LOW)
outputValue1 = map(sensorValue1, 0, 1023, 50, 11236);

but then do I need and 'else' or another 'if' for switch returning HIGH to "fix" the delay time.
Do I need another variable that changes with outputValue1 until switch returns HIGH, then it stays at current value until switch returns LOW?

I got it! ...or one way to do it.

const int analogIn1Pin = A0;
const int timeLockPin = 13;
const int motorPin = 3;
int previous = 0;
int outputValue1 = 0;
int sensorValue1 = 0;

void setup(){
pinMode(motorPin, OUTPUT);
pinMode(timeLockPin, INPUT);
pinMode(analogIn1Pin, INPUT);
}

void loop(){
sensorValue1 = analogRead(analogIn1Pin);
if (digitalRead(timeLockPin) == HIGH)
outputValue1 = previous;
else {
outputValue1 = map(sensorValue1, 0, 1023, 50, 11236);
previous = outputValue1; }

digitalWrite(motorPin, HIGH);
delay(outputValue1);
digitalWrite(motorPin, LOW);
delay(1150);
}

this works great for me. thought i'd share.