ARLISS2012

Dependencies:   mbed-rtos mbed MMA7361L MPL115A2

Fork of rtos_basic by mbed official

Files at this revision

API Documentation at this revision

Comitter:
AkiraK
Date:
Thu Aug 30 08:52:03 2012 +0000
Parent:
3:b740280416f6
Child:
5:31bafc5b1bcd
Commit message:
2012?08?30;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Aug 24 02:26:51 2012 +0000
+++ b/main.cpp	Thu Aug 30 08:52:03 2012 +0000
@@ -110,6 +110,13 @@
                     float lx = illu * 3.3 / 3 * 1000;
 
                     end = timer.read_us();
+                    double timers_2 = (end - begin) / 1000000;
+
+                    if(timers_2 > 2000) {
+                        timer_count ++;
+                        begin = timer.read_us(); //timer number read
+                    }
+
                     double timers = (end - begin) / 1000000;
 
                     if(xbee_count > 6) {
@@ -127,11 +134,6 @@
                         }
                     }
 
-                    if(timers > 2000) {
-                        timer_count ++;
-                        begin = timer.read_us(); //timer number read
-                    }
-
                     if(lx > 800) {
                         xbee_count ++;
 
@@ -148,7 +150,6 @@
 
                     if (gps_get == false) {
                         fprintf(fp, "$DATA,%4.1f,%4.1f,%2.2f,%2.2f,%2.2f,%4.1f,%4.1f,%5.2f,#end\r\n", timers + timer_count * 2000, tempv, accelX, accelY, accelZ, press, humi,lx);
-                        xbee.printf("%5.3f\r\n", lx);
                         if(xbee_flag == true) {
                             xbee.printf("$DATA,%4.1f,%4.1f,%2.2f,%2.2f,%2.2f,%4.1f,%4.1f,%5.2f,#end\r\n", timers + timer_count * 2000, tempv, accelX, accelY, accelZ, press, humi,lx);
                         }