-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcd3thermocouple.ino
58 lines (47 loc) · 1.14 KB
/
lcd3thermocouple.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
54
55
56
57
58
// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple
#include <max6675.h>
#include <LiquidCrystal.h>
#include <Wire.h>
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
// make a cute degree symbol
uint8_t degree[8] = {140,146,146,140,128,128,128,128};
void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
lcd.begin(16, 2);
lcd.createChar(0, degree);
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("MAX6675 test");
// go to line #1
lcd.setCursor(0,1);
lcd.print(thermocouple.readCelsius());
#if ARDUINO >= 100
// lcd.write(0);
#else
// lcd.print(0, BYTE);
#endif
lcd.print("C ");
lcd.print(thermocouple.readFarenheit());
#if ARDUINO >= 100
// lcd.write(0);
#else
// lcd.print(0, BYTE);
#endif
lcd.print('F');
delay(1000);
}