Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Name: Gaurav Patilbhau Bhadane

Roll No: SEAI&DB29


Batch: S5

Aim: Write a program to show the temperature and shows a graph of the recent
measurements.

Code:
int baseline_temp=0;
int celcius=0;
int farhenheit=0;

void setup()
{
pinMode(A0,INPUT);
Serial.begin(9600);//comd for displaying in serial monitor
}

void loop()
{
celcius=map(((analogRead(A0) - 20) *3.04),0,1023,-40,125);
farhenheit=((celcius*9)/5 +32);
Serial.print(celcius);
Serial.print("C ");
Serial.print(farhenheit);
Serial.println("F");
delay(1000);
}
Snapshots:

You might also like