Lab9

Dependencies:   mbed HeptaBattery SDFileSystem HeptaCamera_GPS Hepta9axis HeptaTemp HeptaXbee

Files at this revision

API Documentation at this revision

Comitter:
HEPTA
Date:
Wed Sep 13 01:57:24 2017 +0000
Parent:
23:ac2e4bf32370
Commit message:
thermal chamber

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ac2e4bf32370 -r 483cccf1a51e main.cpp
--- a/main.cpp	Tue Sep 12 09:01:49 2017 +0000
+++ b/main.cpp	Wed Sep 13 01:57:24 2017 +0000
@@ -11,15 +11,17 @@
 
 int main()
 {
-    int rcmd=0,cmdflag=0;
+    int rcmd=0,cmdflag=0,i=0;
     float voltage,timer,temp;
     mkdir("/sd/mydir", 0777);
+    xbee.printf("Count Up!\r\n");
     while(1) {
-        wait(1.0);
+        xbee.printf("num = %d\r",i);
+        i++;
         xbee.xbee_recieve(&rcmd,&cmdflag);
-        pc.printf("rcmd=%d, cmdflag=%d\r\n",rcmd, cmdflag);
+        //pc.printf("rcmd=%d, cmdflag=%d\r\n",rcmd, cmdflag);
         if (cmdflag == 1) {
-            pc.printf("Command Get %d\r\n",rcmd);
+            //pc.printf("Command Get %d\r\n",rcmd);
             if(rcmd == 'a') {
                 FILE *fp = fopen("/sd/mydir/test_thermal_10_deg.csv", "w");
                 for(int i = 0; i<120; i++) {
@@ -56,10 +58,10 @@
                 pc.printf("SD test Mode\r\n");
                 FILE *fp = fopen("/sd/mydir/myfile.txt", "w");
                 if(fp == NULL) {
-                    pc.printf("Could not open file for write\r\n");
+                    xbee.printf("Could not open file for write\r\n");
                 } else {
                     fprintf(fp, "\n\rHello World!\n\r");
-                    pc.printf("SD Check Complete!!\r\n");
+                    xbee.printf("SD Check Complete!!\r\n");
                     fclose(fp);
                 }
             }
@@ -75,5 +77,6 @@
             }
             xbee.initialize();
         }//cmdflag = 1
+        wait(1.0);
     }//while
 }//main
\ No newline at end of file