Created
September 5, 2012 00:05
-
-
Save brooksware2000/3628315 to your computer and use it in GitHub Desktop.
Test sketch for the MAX6675 Type-K Thermocouple Breakout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Demonstration sketch for Hobbybotics MAX6675 Thermocouple breakout board. | |
Reads temperature from MAX6675 in celsius and fahrenheit. Prints results to I2C LCD. | |
*/ | |
#include <MAX6675.h> | |
#include <LCD.h> | |
#include <Wire.h> | |
MAX6675 thermocouple; | |
// Default I2C address for LCD is 0 | |
LCD lcd; | |
// make a degree symbol | |
uint8_t degree[8] = {140,146,146,140,128,128,128,128}; | |
void setup() { | |
lcd.begin(20, 4); | |
lcd.createChar(0, degree); | |
thermocouple.init(4, 5, 6); | |
// wait for MAX6675 to stabilize | |
delay(500); | |
lcd.clear(); | |
lcd.setCursor(0, 0); | |
lcd.print("MAX6675 test"); | |
} | |
void loop() { | |
float temp_c; | |
float temp_f; | |
// Read values from the sensor | |
temp_c = thermocouple.measure(thermocouple.TEMPC); | |
temp_f = thermocouple.measure(thermocouple.TEMPF); | |
lcd.setCursor(0,1); | |
lcd.print(temp_c); | |
lcd.write((byte)0); | |
lcd.print("C "); | |
lcd.print(temp_f); | |
lcd.write((byte)0); | |
lcd.print('F'); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment