Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Default connection is using software SPI, but comment and uncomment one of
- // the two examples below to switch between software SPI and hardware SPI:
- // Example creating a thermocouple instance with software SPI on any three
- // digital IO pins.
- int thermoCLK = 11;
- int thermoCS = 12;
- int thermoDO = 13;
- // initialize the Thermocouple
- Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
- // Example creating a thermocouple instance with hardware SPI
- // on a given CS pin.
- //#define MAXCS 10
- //Adafruit_MAX31855 thermocouple(MAXCS);
- void setup() {
- while (!Serial); // wait for Serial on Leonardo/Zero, etc
- Serial.begin(9600);
- Serial.println("MAX31855 test");
- // wait for MAX chip to stabilize
- delay(500);
- }
- void loop() {
- // basic readout test, just print the current temp
- Serial.print("Internal Temp = ");
- Serial.println(thermocouple.readInternal());
- double c = thermocouple.readCelsius();
- if (isnan(c)) {
- Serial.println("Something wrong with thermocouple!");
- } else {
- Serial.print("C = ");
- Serial.println(c);
- }
- //Serial.print("F = ");
- //Serial.println(thermocouple.readFarenheit());
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement