Program to take input from sensors for near space research project. Program outputs temperature and sensor id into a .txt file stored in an sd card. ExtendedTimer is used instead of Timer.

Dependencies:   DS1820 ExtendedTimer SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
JLarkin
Date:
Mon Apr 17 20:32:43 2017 +0000
Parent:
0:da5b15595769
Commit message:
Corrected device ID display so full 64 byte ID

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r da5b15595769 -r a036633bc3c2 main.cpp
--- a/main.cpp	Mon Apr 17 19:09:35 2017 +0000
+++ b/main.cpp	Mon Apr 17 20:32:43 2017 +0000
@@ -98,21 +98,34 @@
     }
     pc.printf("Found %d device(s)\r\n\n", num_devicest);
 
+
+    unsigned long long fullName;
+    unsigned int firstName;
+    unsigned int lastName;
     // Write header row to each file with device IDs
     //tail
     fprintf(outputt,"Time\t");
     for(int count = 0; count < num_devicest; count ++) {
-        fprintf(outputt, "%x\t", probeTail[count]);
+        fullName = probeTail[count]->whoAmI();
+        firstName = fullName >> 32;
+        lastName = fullName;
+        fprintf(outputt, "%x%x\t", firstName, lastName);
     }
     //Arm1
     fprintf(output1,"Time\t");
     for(int count = 0; count < num_devices1; count++) {
-        fprintf(output1, "%x\t", probe1[count]);
+        fullName = probe1[count]->whoAmI();
+        firstName = fullName >> 32;
+        lastName = fullName;
+        fprintf(output1, "%x%x\t", firstName, lastName);
     }
     fprintf(output2,"Time\t");
     //Arm2
     for(int count = 0; count < num_devices2; count++) {
-        fprintf(output2, "%x\t", probe2[count]);
+        fullName = probe2[count]->whoAmI();
+        firstName = fullName >> 32;
+        lastName = fullName;
+        fprintf(output2, "%x%x\t", firstName, lastName);
     }
     fprintf(outputt,"\r\n");
     fprintf(output1,"\r\n");