/*
Código demonstrativo para a aula de Sistemas Embarcados,
Curso de Ciência da Computação e Engenharia da Computação
EEP.
*/
int pino_sensor = 35;
const float BETA = 3950;
void setup() {
Serial.begin(115200);
}
void loop() {
int temp_c = 1 / (log(1 / (4095. / analogRead(pino_sensor) - 1)) / BETA + 1.0 / 298.15) - 273.15;
int temp_f = (temp_c * 9) / 3.3 + 32;
Serial.print(temp_c, DEC);
Serial.print(" C, ");
Serial.print(temp_f, DEC);
Serial.println(" F");
delay(1000);
}