test

Dependencies:   LM75B Color mbed yeswecancoap Rgb

Files at this revision

API Documentation at this revision

Comitter:
de_geeter_alexander
Date:
Fri Oct 23 14:48:16 2015 +0000
Parent:
0:06473a4ace3b
Child:
2:ba4506b61052
Commit message:
test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Oct 23 13:37:50 2015 +0000
+++ b/main.cpp	Fri Oct 23 14:48:16 2015 +0000
@@ -7,13 +7,17 @@
 LM75B sensor(p28,p27);
 RGB* rgb;
 
+
 void get_hello(Request* req, Response* res)
 {
     if(req->hasContent()) {
            
     }
-    
-    res -> setContent((float)sensor), 13);
+    char array[10];
+    sprintf(array, "%f", (float) sensor);
+    string n;
+    n=sprintf (array, "%f", n);
+    res -> setContent(array, 9);
     res -> setCode(CONTENT);   
 }
 
@@ -45,11 +49,7 @@
         server.waitForRequest();
         pc.printf("Device detected!\n");
  
-        while (1) {
-            
-            pc.printf("Temp = %.3f\n", (float)sensor);
-            wait(1.0);
-        }
+    
  
     }