error code ; before )

const int sensorPin = A0;
const float baselineTemp=20.0;
void setup() {

Serial.begin(9600);

for (int pinNumber=2; pinNumber<5; pinNumber++;){
pinMode(2, OUTPUT);
digitalWrite(pinNumber, Low);
}
}

void loop() {
int sensorVal = analogRead(sensorPin);
Serial.print ("Sensor Value: “);
Serial.print(sensorVal);
float voltage = (sensorVal/1024)*5;
Serial.print (”, Volts: “);
Serial.print(voltage);
Serial.print (”, degress C: ");
float temperature = (voltage -.5)*100;
Serial.println (temperature);

if(temperature < baselineTemp)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if (temperature >= baselineTemp+2 && temperature < baselineTemp+4)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if(temperature>= baselineTemp+4 && temperature < baselineTemp+6)
{
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
}
else if(temperature>= baselineTemp+6)
{
digitalWrite(2, HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
}
delay (1) ;

}

error code ; expected before ) line 49.

I see a problem but it is long before line 49.

This:

for (int pinNumber=2; pinNumber<5; pinNumber++;){

should not have the third (last) semicolon in it. It should look like this:

for (int pinNumber=2; pinNumber<5; pinNumber++){

In the future, please follow these instructions for the forum:

To post code and/or error messages:

  1. Use CTRL-T in the Arduino IDE to autoformat your complete code.
  2. Paste the complete autoformatted code between code tags (the </> button)
    so that we can easily see and deal with your code.
  3. Paste the complete error message between code tags (the </> button)
    so that we can easily see and deal with your messages.
  4. If you already posted without code tags, you may add the code tags by
    editing your post. Do not change your existing posts in any other way.
    You may make additional posts as needed.

Before posting again, you should read the three locked topics at the top of the Programming Questions forum, and any links to which these posts point.

If your project involves wiring, please provide a schematic and/or a wiring diagram and/or a clear photograph of the wiring.

Good Luck!

When you fix the problem pointed out by vaj4088, also change this:-digitalWrite(pinNumber, Low);to this:-digitalWrite(pinNumber, LOW);(C++ is case-sensitive)

Then your code should compile fine.

Edit: But it probably won’t do what you want. Only pin 2 is made an output by this:-

 for (int pinNumber = 2; pinNumber < 5; pinNumber++)
    {
        pinMode(2, OUTPUT);
        digitalWrite(pinNumber, LOW);
    }

Perhaps you really meant:-

 for (int pinNumber = 2; pinNumber < 5; pinNumber++)
    {
        pinMode(pinNumber, OUTPUT);
        digitalWrite(pinNumber, LOW);
    }

Also, this won’t produce a floating point result:-float voltage = (sensorVal/1024)*5;
But this will:-float voltage = (sensorVal/1024.0)*5.0;