Instructions
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
On the serial monitor the temperature output can be monitored.
int potPin = 0; // sets sensor to ananlog pin 0
void setup() {
Serial.begin(9600); // sets baudrate to 9600
}
void loop() {
int val; // defines variable val
int dat; // defines variable dat
val=analogRead(0); // reads the analog value from sensor
dat=(125*val)>>8; // Temperature calculation formula
Serial.print("Temp:"); // output begins with Temp:
Serial.print(dat); // prints the calculated temperature
Serial.println(" *C"); // dispalys "*C"
delay(500); // waits 0.5 seconds
}