#include <LiquidCrystal.h>
#define tempSensor 0
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); //RS, Enable, D4, D5, D6, D7
int Vin; // Variable to read the value from the Arduino’s pin A0
float TC; // Variable that receives the converted voltage value to ºC temperature
void setup()
{
lcd.begin(16, 2);
delay(2000);
lcd.clear();
Serial.begin(9600);
}
void loop()
{
Vin = analogRead (tempSensor); // Tells the Arduino to read A0 and stores the value in “Vin”
TC=(5*100*Vin)/1024.0; // Converts the voltage value into temperature and stores it into the “TC” variable (in ºC)
lcd.setCursor(0, 0); // Moves the cursor of the display to the next line
lcd.print (TC);
lcd.print((char)223);// degree symbol
lcd.print("C");
Serial.print("DATA,TIME,"); Serial.println(TC);
delay(1000);
}