void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int sensorReading = analogRead(A0); // to read the sensor value and to store it in a variable
// to convert the sensorReading in to a temperature value
int celsius =1 / (log(1 / (1023.0 / sensorReading - 1)) / 3950.0 + 1.0 / 298.15) - 273.15;
// to display the temperature value
Serial.print(celsius);
Serial.println("C");
delay(1000);
}