const int LM_35 = A0;
// Assigning Pin to LM35
int input_val = 0;
// TO store input value
float temp = 0;
// To store final temperature output
void setup() {
Serial.begin(115200);
}
void loop() {
input_val =
analogRead(LM_35); // Reading
analog input
temp = (5.0 *
input_val * 100.0) / 1024; // Some
calculation to convert analog value to temperature
Serial.print("Temperature is : " );
Serial.println(temp);
delay(1000);
}
No comments:
Post a Comment