Sample program for the MAX31855. Prints out the temperature read to console.

Dependencies:   MAX31855 mbed

Files at this revision

API Documentation at this revision

Comitter:
Stavlin
Date:
Tue Oct 23 10:55:17 2012 +0000
Parent:
0:c50a2801c243
Commit message:
Altered to use new fault code setup.

Changed in this revision

MAX31855.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c50a2801c243 -r 6bed4f6f7b35 MAX31855.lib
--- a/MAX31855.lib	Mon Oct 22 09:42:16 2012 +0000
+++ b/MAX31855.lib	Tue Oct 23 10:55:17 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Stavlin/code/MAX31855/#656c522152d4
+http://mbed.org/users/Stavlin/code/MAX31855/#5eeee89cb281
diff -r c50a2801c243 -r 6bed4f6f7b35 main.cpp
--- a/main.cpp	Mon Oct 22 09:42:16 2012 +0000
+++ b/main.cpp	Tue Oct 23 10:55:17 2012 +0000
@@ -26,8 +26,18 @@
             //Get the reading
             fvalue = max1.read_temp();
             
-            printf("Temperature is: %f\n\r", fvalue);
-        }
+            if (fvalue > 2000){
+                if(fvalue==2001){
+                    printf("No TC");
+                }else if(fvalue==2002){
+                    printf("Short to Ground");
+                }else if(fvalue==2004){
+                    printf("Short to VCC");
+                }
+            }else{
+                printf("Temperature is: %f\n\r", fvalue);
+            }
+     }
         
         //Heartbeat signal (not necessary)
         myled = !myled;