Stap 4: Code!!!
Code:-
float temp;
int WaardeInstellen (SetValue) = 40;
int tempPin = A0;
int fan = 9;
#include LiquidCrystal lcd (7, 6, 5, 4, 3, 2);
VOID Setup {}
LCD.begin (16, 2);
pinMode(fan,OUTPUT);
Serial.begin(9600);
}
void loop {}
LCD.Clear();
Temp = analogRead(tempPin);
temp temp = * 0.48828125;
Als (temp WaardeInstellen) {}
int fanpwm = map(temp,setValue,140,75,255);
analogWrite(fan,fanpwm);
LCD.Clear();
LCD.Print("Warning");
lcd.setCursor(0,1);
LCD.Print ("hoge Temp:-");
lcd.setCursor(11,1);
LCD.Print(temp);
delay(40);
}
}