Data Sheet

ARDUINO CODE
LESSON 9
| 37
int sensorPin = A0;
int sensorValue = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin);
Serial.print("ADC :");
Serial.print(sensorValue);
Serial.print(" Temperature : ");
Serial.print(sensorValue*0.488); // Convert ADC to Celcius
Serial.print(186); // ASCII degree symbol
Serial.println("C");
delay(100);
}
RESULT
ADC and temperature value displays on Arduino Serial Monitor (need to open
Arduino Serial Monitor).