Skip to content

Instantly share code, notes, and snippets.

@brooksware2000
Created August 9, 2012 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brooksware2000/3299892 to your computer and use it in GitHub Desktop.
Save brooksware2000/3299892 to your computer and use it in GitHub Desktop.
Example sketch for the MAX6675 Type-K Thermocouple sensor
/*
Demonstration sketch for Hobbybotics MAX6675 Thermocouple breakout board.
Reads temperature from MAX6675 in celsius and fahrenheit. Prints results to serial monitor.
*/
#include <MAX6675.h>
MAX6675 thermocouple;
void setup() {
Serial.begin(9600);
thermocouple.init(4, 5, 6);
Serial.println("MAX6675 test");
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(float(thermocouple.measure(TEMPC)));
Serial.print("F = ");
Serial.println(float(thermocouple.measure(TEMPF)));
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment