2013
Dependencies: BMP085_2 SDFileSystem mbed
Fork of cansat new by
Diff: main.cpp
- Revision:
- 5:9cfdae50349e
- Parent:
- 4:5872b6ac17e5
- Child:
- 6:3cc5c120fbe3
--- a/main.cpp Tue Jul 30 11:24:17 2013 +0000 +++ b/main.cpp Wed Jul 31 10:59:58 2013 +0000 @@ -1,6 +1,6 @@ #include "mbed.h" #include "SDFileSystem.h" -#include "bmp085.h" +#include "BMP085.h" SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board Serial xbee(p13,p14); // tx, rx @@ -21,10 +21,10 @@ int main() { float r_temp, temp; - float vo,ax,ay,az, light; + float vo,ax,ay,az, light,P,t; - //FILE* fp = NULL; - //fp = fopen("/sd/CanSat.txt", "a"); + FILE* fp = NULL; + fp = fopen("/sd/CanSat.txt", "a"); unsigned count = 0; //time_t epoch = 0; @@ -56,10 +56,10 @@ fprintf(fp, "L %5.2f ",light); fprintf(fp, "P %6.2f ", P); fprintf(fp, "t %6.2f ", t); - fprintf(fp,"\n"); + fprintf(fp,"\n\r"); }//if - if (count % 100 == 0) { + if (count % 10 == 0) { xbee.printf("S %f ", seconds); xbee.printf("T %5.2f ",r_temp); xbee.printf("H %5.2f ",((vo*8-6)/25)); @@ -73,7 +73,7 @@ }//if ++count; - wait(0.01); + wait(0.1); }//while - //fclose(fp); + fclose(fp); }