user60569: if(temperature < baselineTemp)else{
  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)


user31105: No, the first lines should be:
if(temperature < baselineTemp) {
  digitalWrite(2, LOW);

Thus the else should be removed; after the first if and later else or else if conditions, statements can be placed.
Next time align your code by selecting it and select ctrl-K.
Also, your code can be much more simplified.
Hence the following (reverse engineered) requirements:

pin 2 is HIGH when temperature >= baselineTemp + 2, else LOW
pin 3 is HIGH when temperature >= baselineTemp + 4, else LOW
pin 4 is HIGH when temperature >= baselineTemp + 4, else LOW

So your entire code can be written as:
digitalWrite(2, temperature >= baselineTemp + 2 ? HIGH : LOW);
digitalWrite(3, temperature >= baselineTemp + 4 ? HIGH : LOW);
digitalWrite(4, temperature >= baselineTemp + 6 ? HIGH : LOW);


60569: <pre><code>if(temperature &lt; baselineTemp)else{
  digitalWrite(2, LOW);
  digitalWrite(3, LOW);
  digitalWrite(4, LOW);
}else if(temperature &gt;= baselineTemp+2 &amp;&amp; temperature &lt; baselineTemp+4){
  digitalWrite(2, HIGH)
  digitalWrite(3, LOW)
  digitalWrite(4, LOW)
}else if(temperature &gt;= baselineTemp+4 &amp;&amp; temperature &lt; baselineTemp+6){
  digitalWrite(2, HIGH)
  digitalWrite(3, HIGH)
  digitalWrite(4, LOW)
}else if(temperature &gt;= baselineTemp+6){
  digitalWrite(2, HIGH)
  digitalWrite(3, HIGH)
  digitalWrite(4, HIGH)
</code></pre>
 31105: <p>No, the first lines should be:</p>

<pre><code>if(temperature &lt; baselineTemp) {
  digitalWrite(2, LOW);
</code></pre>

<p>Thus the <code>else</code> should be removed; after the first <code>if</code> and later <code>else</code> or <code>else if</code> conditions, statements can be placed.</p>

<p>Next time align your code by selecting it and select ctrl-K.</p>

<p>Also, your code can be much more simplified.</p>

<p>Hence the following (reverse engineered) requirements:</p>

<ul>
<li>pin 2 is HIGH when temperature >= baselineTemp + 2, else LOW</li>
<li>pin 3 is HIGH when temperature >= baselineTemp + 4, else LOW</li>
<li>pin 4 is HIGH when temperature >= baselineTemp + 4, else LOW</li>
</ul>

<p>So your entire code can be written as:</p>

<pre><code>digitalWrite(2, temperature &gt;= baselineTemp + 2 ? HIGH : LOW);
digitalWrite(3, temperature &gt;= baselineTemp + 4 ? HIGH : LOW);
digitalWrite(4, temperature &gt;= baselineTemp + 6 ? HIGH : LOW);
</code></pre>
