Skip to content
Browse files

Check for thermocouple problems

  • Loading branch information...
1 parent 2e3ce1e commit cc425e9315a9765fee1f06f70382b19a864d30b9 @ladyada ladyada committed Jun 8, 2012
Showing with 10 additions and 4 deletions.
  1. +10 −4 examples/serialthermocouple/serialthermocouple.pde
View
14 examples/serialthermocouple/serialthermocouple.pde
@@ -34,10 +34,16 @@ void loop() {
// basic readout test, just print the current temp
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
- Serial.print("C = ");
- Serial.println(thermocouple.readCelsius());
- Serial.print("F = ");
- Serial.println(thermocouple.readFarenheit());
+
+ 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);
}

0 comments on commit cc425e9

Please sign in to comment.
Something went wrong with that request. Please try again.