Hey guys, so a couple weeks back i posted something about my code not working for my project. Well i fixed that issue and finally found myself with time again to finish up the project but ran into something else. After making sure the code was fine and uploading it, i the LEDs do not light up or anything. Like if i open up the serial monitor i can see a bunch of data and it seems that the temperature sensor might be working but i'm not sure. I'll upload pictures of my set up along with my code, just in case there is something wrong with either.
Serial.print(sensorVal);
// Convert the ADC reading to voltage
float voltage = (sensorVal/1024.0)*5.0;
Serial.print(" ,Volts: ");
Serial.print(voltage);
Serial.print(" , degrees C: ");
// convert the voltage to temperature in degrees
float temperature = (voltage - .5) * 100;
Serial.print(temperature);
if(temperature < baselineTemp+2){
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+2 && temperature < baselineTemp+6){
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
}
delay(1);
}