what does unqualified-id before 'while'

What does this error mean? How do I correct it?

/* Read from the input
If it is positive, then delay 1 and read from it again
If it is negative, then delay 1 and read from it
Now the first positive transition has been found
So initialize value and read from the input again
While the input is positive, add 1 to count, delay and read from it again
When it goes negative, we now have a measurement of a positive pulse duration
So we can print it and quit or go back to the top
/
/
First do data definitions /
int Totalms = 0 // millisecond count
int Highms = 0 //total millisecond count
float InputVoltage = 0.0 // voltage level
float PositivePulse = 2.5 // pulse is positive if GTEQ 2.5
const int AnalogInputPin = A0 //analog input pin number
void setup() {
// put your setup code here, to run once:

// initialize serial communications at 9600 bps
Serial.begin(9600) ;

}

void loop() {
// put your main code here, to run repeatedly:
InputVoltage = analogRead(AnalogInputPin ;
if(InputVoltage >= PositivePulse)
{delay(1);
}
// Wait for the voltage to be LT 2.5
// Once it is LT 2.5, wait for it to be positive to find the start of the high pulse
if(InputVoltage <PositivePulse) {
delay(1);
}
void loop() {
// Now the first positive transition has been found */
// Now read from the input and while it is GTEQ 2.5, add 1 to the high millisecond count and 1 to the total millisecond count, delay and read it again
while(InputVoltage >= PositivePulse) {
Totalms = Totalms + 1;
Highms = Highms+1;
delay(1);
}
Serial.print("Total milliseconds = ", Totalms, " High milliseconds = ", Highms)
return 0;

}

Do a ctrl-T in the IDE to do an auto format and you will instantly see the problem.

/*  First do data definitions /
int Totalms = 0 // millisecond count
int Highms = 0 //total millisecond count
float InputVoltage = 0.0 // voltage level
float PositivePulse = 2.5 // pulse is positive if GTEQ 2.5
const int AnalogInputPin = A0 //analog input pin number
void setup() {

You didn't close your comments with a '*/'. That comment block also comments out all those declaration lines.

Thankyou, thankyou, thankyou. I did not know about Ctrl-T. Got it all to compile without error after fixing that and about a dozen other errors that showed up after I fixed the first one.. Don't know if it will run or what it will produce. I have to say that "C" error messages are about the most obscure I have ever seen, but then, I am definitely a beginner at "C".

vernonls: Thankyou, thankyou, thankyou. I did not know about Ctrl-T. Got it all to compile without error after fixing that and about a dozen other errors that showed up after I fixed the first one.. Don't know if it will run or what it will produce. I have to say that "C" error messages are about the most obscure I have ever seen, but then, I am definitely a beginner at "C".

One thing, usually the first error (at the top of the list) is the real problem - sometimes fixing the first one reduces a list of dozens of errors to zero. So always look there first - it will also cite a line number.

An IDE sketch comes with two functions --

void setup()
{

}

void loop()
{

}

Why are there two loop() functions in your sketch?

And don’t forget the semicolons where they are needed

And if a function is defined void, you don’t want to be returning values from it.

Hi, Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum". OR http://forum.arduino.cc/index.php/topic,148850.0.html. Then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

What model Arduino are you using?

Thanks.. Tom... :)