float reading;
float voltage;
float temp_c;
float temp_f;
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
reading = analogRead(A0);
voltage = reading * 5 / 1024;
temp_c = (voltage - 0.5) + 100;
temp_f = (temp_c * 9/5) + 32;
Serial.println("Analog Reading : " + String(reading));
Serial.println("Voltage Reading : " + String(voltage));
Serial.println("Celsius Reading : " + String(temp_c) + "C");
Serial.println("Farhrenheit Reading : " + String(temp_f) + "F/n");
}