-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLCD.ino
More file actions
54 lines (40 loc) · 1 KB
/
Copy pathLCD.ino
File metadata and controls
54 lines (40 loc) · 1 KB
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
54
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 9
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
lcd.begin(16,2);
byte heart[8] =
{
0b00000,
0b01010,
0b11111,
0b11111,
0b11111,
0b01110,
0b00100,
0b00000
};
lcd.createChar(1,heart);
Serial.begin(9600);
sensors.begin();
}
void loop() {
/
sensors.requestTemperatures();
delay(25);
Serial.println("Celsius temperature: ");
Serial.println(sensors.getTempCByIndex(0));
delay(1000);
delay(500);
lcd.setCursor(2,1);
lcd.print("Celsius ");
lcd.print (sensors.getTempCByIndex(0));
delay(2000);
lcd.clear();
lcd.noCursor();
lcd.clear();
}