BMP085を入れました
Dependencies: BMP085_2 SDFileSystem mbed
Diff: main.cpp
- Revision:
- 2:e093c70066d0
- Parent:
- 1:6dc59f48b649
- Child:
- 3:37b076ff27a9
--- a/main.cpp Sun Jul 28 06:44:40 2013 +0000 +++ b/main.cpp Sun Jul 28 07:14:39 2013 +0000 @@ -20,36 +20,42 @@ FILE* fp = fopen("/local/CanSat.txt", "a"); unsigned count = 0; + time_t epoch = 0; - while(1){ - temp = temp_in; - vo = v_out/10*33; - ax = acc_x/10; - ay = acc_y/10; - az = acc_z/10; - light = light_in/10*33; - r_temp = temp_in * 3.3 * 100 ; + fprintf(fp, "E %d \r", epoch); + while(1){ + epoch = time(NULL); + temp = temp_in; + vo = v_out/10*33; + ax = acc_x/10; + ay = acc_y/10; + az = acc_z/10; + light = light_in/10*33; + r_temp = temp_in * 3.3 * 100 ; - fprintf(fp, "T %5.2f ",r_temp); - fprintf(fp, "H %5.2f ",(vo*8-6)/25); - fprintf(fp, "X %5.2f ",(ax*33-1.65)/0.66); - fprintf(fp, "Y %5.2f ",(ay*33-1.65)/0.66); - fprintf(fp, "Z %5.2f ",(az*33-1.65)/0.66); - fprintf(fp, "L %5.2f",light); - fprintf(fp,"\n\r"); + fprintf(fp, "E %d ", epoch); + fprintf(fp, "T %5.2f ",r_temp); + fprintf(fp, "H %5.2f ",(vo*8-6)/25); + fprintf(fp, "X %5.2f ",(ax*33-1.65)/0.66); + fprintf(fp, "Y %5.2f ",(ay*33-1.65)/0.66); + fprintf(fp, "Z %5.2f ",(az*33-1.65)/0.66); + fprintf(fp, "L %5.2f",light); + fprintf(fp,"\n"); - if (count % 10 == 0) { - xbee.printf("T %5.2f ",r_temp); - xbee.printf("H %5.2f ",((vo*8-6)/25)); - xbee.printf("X %5.2f, ",(ax*33-1.65)/0.66); - xbee.printf("Y %5.2f, ",(ay*33-1.65)/0.66); - xbee.printf("Z %5.2f",(az*33-1.65)/0.66); - xbee.printf("L %5.2f",light); - xbee.printf("\n\r"); - }//if + if (count % 100 == 0) { + xbee.printf("E %d ", epoch); + xbee.printf("T %5.2f ",r_temp); + xbee.printf("H %5.2f ",((vo*8-6)/25)); + xbee.printf("X %5.2f ",(ax*33-1.65)/0.66); + xbee.printf("Y %5.2f ",(ay*33-1.65)/0.66); + xbee.printf("Z %5.2f ",(az*33-1.65)/0.66); + xbee.printf("L %5.2f",light); + xbee.printf("\n\r"); + }//if - wait(0.1); - } - // fclose(fp); + ++count; + wait(0.01); + }//while + //fclose(fp); }