float temp; // Variable to store temperature value
int tempPin = 0; // Analog pin where the temperature sensor is connected
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
}
void loop() {
temp = analogRead(tempPin); // Read analog voltage from temperature sensor
temp = temp * 0.48828125; // Convert analog voltage to temperature in degrees Celsius
Serial.print("TEMPERATURE = "); // Print text indicating temperature reading
Serial.print(temp); // Print temperature value
Serial.print("*C"); // Print Celsius symbol
Serial.println(); // Move to next line in serial monitor
delay(1000); // Wait for 1 second before taking the next reading
}