plz delete
Did you load your sketch? You may be running a sketch written by a previous student in your class. We know it's a class because there's a wave of questions on this particular hardware configuration.
yes I uploaded it and verified it.
You print the temperature once, in setup(); but as you have not read any temperature yet the value will be 0 (global variables are initialised with 0 if not instructed otherwise).
Add a lcd.setCursor and lcd.print to loop after you have calculated TempC..
thank you for all ur help, but now it changed to =-50
You need to post your updated code; and please use code tags when posting code (read the sticky how to use the forum).
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int Tempsensor;
int mV;
int TempC;
void setup()
{
lcd.begin(16,2);
lcd.setCursor(1,0);
lcd.print("Temperature(C)=");
lcd.setCursor(1,1);
lcd.print(TempC);
}
void loop()
{
pinMode(A0,INPUT);
Tempsensor=analogRead(A0);
mV=((Tempsensor/1024.0)*5);
TempC = (mV-0.5) * 100.0;
lcd.setCursor(1,1);
lcd.print(TempC);
}
Make mV a float (not int):
int mV;
Please delete post #7, which contains only improperly posted code.
I don't have the sensor, but connected A0 to GND, 3.3V and 5V and get -50, 250 and 350 respectively from your code.
Can't really help further.