// Analog Pin zur Eingabe des Temperatursensors
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
void setup() {
// put your setup code here, to run once:
for ( int thisPin = 5; thisPin <= 9; thisPin++ ){
pinMode(thisPin, OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
int analogValue = analogRead(0);
float degreesC = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
int timer = 100;
if (degreesC >= -24 && degreesC < 0){
for ( int thisPin = 5; thisPin <= 5; thisPin++ ){
digitalWrite(thisPin, HIGH);
}
}
else if (degreesC >= 0 && degreesC < 20){
for ( int thisPin = 5; thisPin <= 6; thisPin++ ){
digitalWrite(thisPin, HIGH);
}
}
else if (degreesC >= 20 && degreesC < 40){
for ( int thisPin = 5; thisPin <= 7; thisPin++ ){
digitalWrite(thisPin, HIGH);
}
}
else if (degreesC >= 40 && degreesC < 60){
for ( int thisPin = 5; thisPin <= 8; thisPin++ ){
digitalWrite(thisPin, HIGH);
}
}
else if (degreesC >= 60){
for ( int thisPin = 5; thisPin <= 9; thisPin++ ){
digitalWrite(thisPin, HIGH);
}
}
for ( int thisPin = 5; thisPin <= 9; thisPin++ ){
digitalWrite(thisPin, LOW);
}
}