Output based on time and voltage threshold

I have a signal that is changing from 0 to 5 volts a few times a second, said circuit also becomes open at times as well.

I am trying to write the program so i have an output when the signal drops below a certain voltage threshold as well as drops for a said amount of time (to signal when circuit is open). below is what i have so far, not working, any help is appreciated.

const int analogPin = A0;
const int ledPin = 13;
const int voltage threshold = 1000;
unsigned long startTime;
unsigned long elapsedTime ;

void setup() {

pinMode(ledPin, OUTPUT);

Serial.begin(9600);

}

void loop() {

int analogValue = analogRead(analogPin);

if (analogValue < voltagethreshold); {
digitalWrite(ledPin, HIGH);
}

Serial.println(analogValue);
}
[code]
if (analogValue < voltagethreshold); {

Can you find a single example, anywhere, where the if statement ends with a semicolon?

... and does anything useful ... :wink:

PaulS:

if (analogValue < voltagethreshold); {

Can you find a single example, anywhere, where the if statement ends with a semicolon?

your right about that, checked the example and should not be a semi colon there.