void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(2, INPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(14, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int analogValue = analogRead(2);
float celsius = map(analogValue,3813,462,-24,80);
Serial.println(celsius);
if(celsius >= 10){
digitalWrite(12, HIGH);
}else{
digitalWrite(12, LOW);
}
if(celsius >= 20){
digitalWrite(13, HIGH);
}else{
digitalWrite(13, LOW);
}
if(celsius >= 30){
digitalWrite(14, HIGH);
}else{
digitalWrite(14, LOW);
}
}