I show the code I am using (I use a bluetooth mate gold in order to transmit the value to an Android Aplication, so I only transmit a value of byte because the degrees measured wont be higher than 255, and bluetooth only write a byte).
//LilyPad + Temperature Sensor
int tsensorPin = 2; // Temperature sensor is connected to analog pin 2.
int tempValue; // Variable to store the value coming from de temperature sensor.
#define BANDGAPREF 2 // Special indicator that we want to measure the bandgap.
float lectura=0;
float supplyvoltage;
int refReading;
float temp;
void setup()
{
Serial.begin(115200);
}
void loop()
{
//Read the temperature.
lectura = analogRead(tsensorPin);
//Get voltage reading from the secret internal 1.1V reference
refReading = analogRead(BANDGAPREF);
//Now calculate our power supply voltage from the known 1.1V reference.
supplyvoltage = (1.1 * 1024.0) / refReading;
lectura = lectura * (supplyvoltage/1024.0);
temp = (lectura - 0.5) * 100;
tempValue = (byte)temp;
Serial.write(tempValue);
//Delay
delay(1000);
}