![](/media/cache/profiles/e1f5448f160187bcb4c4acaacfb3456c.50x50_q85.jpg)
ARLISS2012
Dependencies: mbed-rtos mbed MMA7361L MPL115A2
Fork of rtos_basic by
Diff: main.cpp
- Revision:
- 4:4faccc542b32
- Parent:
- 3:b740280416f6
- Child:
- 5:31bafc5b1bcd
--- 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); }