int sensor = 34;
int leitura = 0;
float BETA = 3950;
float temp = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
leitura = analogRead(sensor);
temp = 1/(log(1/(4095.0/leitura -1.0))/BETA +1.0/298.15) -273.15;
Serial.print("Temperatura:");
Serial.print(temp);
Serial.print("°C");
delay(1000);
}