-
Notifications
You must be signed in to change notification settings - Fork 0
/
Thermometer.ino
53 lines (51 loc) · 1.16 KB
/
Thermometer.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include<LiquidCrystal.h>
LiquidCrystal lcd(7,6,5,4,3,2);
const int Sensor = A0;
byte degree_symbol[8] =
{
0b00111,
0b00101,
0b00111,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
void setup()
{
pinMode(12, OUTPUT);
pinMode(Sensor, INPUT);
lcd.begin(16,2);
lcd.createChar(1, degree_symbol);
lcd.setCursor(0,0);
lcd.print(" TEAM XFINITY ");
digitalWrite(12, HIGH);
// lcd.print(" suri_kumkaran ");
lcd.setCursor(0,1);
// lcd.print(" ROCKS ");
lcd.print(" Presents ");
delay(3000);
lcd.setCursor(0,0);
lcd.print(" Digital ");
lcd.setCursor(0,1);
lcd.print(" Thermometer ");
delay(4000);
lcd.clear();
}
void loop()
{
float temp_reading=analogRead(Sensor);
float temperature=temp_reading*(5.0/1023.0)*100;
delay(100);
digitalWrite(12, HIGH);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temperature in C");
lcd.setCursor(4,1);
lcd.print(temperature);
lcd.write(1);
lcd.print("C");
delay(1000);
digitalWrite(12, LOW);
}