Skip to content

Commit

Permalink
Display LCD temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Jul 24, 2010
1 parent 57fd27a commit 833d361
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions examples/lcdthermocouple/lcdthermocouple.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// this example is public domain. enjoy!
// www.ladyada.net/learn/sensors/thermocouple

#include <max6675.h>
#include <LiquidCrystal.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());
lcd.print(0, BYTE);
lcd.print("C ");
lcd.print(thermocouple.readFarenheit());
lcd.print(0, BYTE);
lcd.print('F');

delay(1000);
}

0 comments on commit 833d361

Please sign in to comment.