[

/*
Based on code from Adafruit:
http://www.ladyada.net/learn/sensors/tmp36.html

and from:
http://code.google.com/p/tinkerit/wiki/SecretThermometer
*/

int tempPin = 2; // TMP-36
int tempReading = 0;
float temperatureC = 0;
float temperatureF = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {

    // READ TEMPERATURE
    tempReading = analogRead(tempPin);

    // convert readings to voltage, using 5V battery
    float tempVoltage = tempReading * 5;
    tempVoltage /= 1024.0;

    // now print out the temperature
    temperatureC = (tempVoltage - 0.5) * 100 ;  //converting from 10 mv per degree with 770 mV offset
    //to degrees ((volatge - 770mV) times 100)
    Serial.println("degrees C: "); Serial.print(temperatureC);

    // READ ARDUINO'S TEMP
    long result;
    // Read temperature sensor against 1.1V reference
    ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
    delay(2); // Wait for Vref to settle
    ADCSRA |= _BV(ADSC); // Convert
    while (bit_is_set(ADCSRA,ADSC));
    result = ADCL;
    result |= ADCH<<8;
    result = (result - 125) * 1075;
    Serial.println("Internal Temp: "); Serial.print(result/1000);

    delay(1000);
}

]