Page 27 - Assessment No 1- 257
P. 27

float mv=(val/1024.0)*5000;//value convert to minivolt as

               digital value, if multiply by 5 it


               recieved volt


                float cel =mv/10;// 10 milli volt = 1 celcious



                float farh=(cel*9)/5+32;// if want to convert kelvin


               val=analogRead(TempSensor);



                Serial.print("TEMPRATURE =");


                Serial.print("celcious :");



                Serial.print(cel);


                Serial.print("*C ");


                Serial.print("Faranhite :");



                Serial.print(farh);


                Serial.print("*F ");



                Serial.println();


                delay(1000);


               }
   22   23   24   25   26   27   28   29   30   31   32