const int sensorPin = A0; // Pin connected to the sensor's output
float temperature; // Variable to store the temperature value
void setup() {
Serial.begin(9600); // Start the serial communication
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
temperature = sensorValue * (5.0 / 1023.0) * 100.0; // Convert the analog value to temperature in Celsius
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
delay(1000); // Wait for a second before taking another reading
}