Problem with Vex Limit Switch

I am trying to finish a project for school but I am having a problem with the input coming in from a VEX limit switch. My problem is that whenever I press the limit switch it sends out a one like it should but it takes anywhere from 10-30 seconds to switch back to a zero. I have had my instructor look at it and he had no idea so I'm wondering if anyone had any ideas? I have the functional part of the code block with a comment but for some reason the input is still being skewed. Thank you.

_4.2.4_TollBooth.ino (1.97 KB)

const int potPin = A0; //Defining Potentiometer to pin A0
int potValue = analogRead (potPin); //read for potentiometer
const int limOPin = 8; //Defining Limit Switch for Open to A1
int limOValue = 0; //digitalRead (limOPin); //read for Limit Open
const int limCPin = 7; //Defining Limit Switch for Close to A2
int limCValue = 0; //digitalRead (limCPin); //read for Limit Close
const int motPin = A1; //Deinifing Motor to A3
const int ledOPin = 2; //Defining Open LED to pin 2
const int ledCPin = 4; //Defining Close LED to pin 4
void setup() {
pinMode (potPin, INPUT); //Labeling the above sensors as inputs and outputs
pinMode (limOPin, INPUT);
pinMode (limCPin, INPUT);
pinMode (motPin, OUTPUT);
pinMode (ledOPin, OUTPUT);
pinMode (ledCPin, OUTPUT);
Serial.begin(9600); //setting serial value
}

void loop() {
potValue = analogRead (A0); //Analog read for the 3 inputs to recieve to values from each.
limOValue = digitalRead (limOPin);
limCValue = digitalRead (limCPin);
Serial.println (limOValue);
Serial.println (potValue);
Serial.println (limCValue);

/* if (potValue >= 512 ) { //using an if statment to acitvate open
if (limOValue == LOW) { //using the limit switch to define motor on
analogWrite (motPin, 10); //turning on the motor
digitalWrite (ledCPin, LOW); //turning off both leds
digitalWrite (ledOPin, LOW);
}
else { //with the limit switch pushed the motor turns off
analogWrite (motPin, 0); //turning motor off
digitalWrite (ledOPin, HIGH); //turning led open on
}
}
else { //using an else if statment to activate close{
if (limCValue == LOW) { //using limit switch to define motor on
analogWrite (motPin, -10); //turning motor on
digitalWrite (ledOPin, LOW); //turning off both leds
digitalWrite (ledCPin, LOW);
}
else { //with the limit switch pushed the motor turns off
analogWrite (motPin, 0); //turning motor off
digitalWrite (ledCPin, HIGH); //turning on close LED
}
}*/
}

The "int limOValue = 0; //digitalRead (limOPin); //read for Limit Open" pin must be either pulled high or pulled low . Guess you have left it floating.

Paul