2013
Dependencies: BMP085_2 SDFileSystem mbed
Fork of cansat new by
main.cpp
- Committer:
- yattu0914
- Date:
- 2013-07-28
- Revision:
- 0:2c21bfd10524
- Child:
- 1:6dc59f48b649
File content as of revision 0:2c21bfd10524:
#include "mbed.h" Serial xbee(p13,p14); // tx, rx /*Timeout dater; LocalFileSystem local("local");*/ AnalogIn temp_in(p20); AnalogIn acc_x(p17); AnalogIn acc_y(p18); AnalogIn acc_z(p19); AnalogIn v_out(p16); AnalogIn light_in(p15); int main() { float r_temp, temp; float vo,ax,ay,az, light; // FILE*fp = fopen("/local/CanSat.txt", "a"); 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, "RoomTemp:%5.2f, ",r_temp); fprintf(fp,"Temt:%5.2f, ",((vo*8-6)/25)); fprintf(fp,"acc_x:%5.2f, ",(ax*33-1.65)/0.66); fprintf(fp,"acc_y:%5.2f, ",(ay*33-1.65)/0.66); fprintf(fp,"acc_z:%5.2f",(az*33-1.65)/0.66); fprintf(fp,"light:%5.2f",light); fprintf(fp,"\n\r");*/ xbee.printf("RoomTemp:%5.2f, ",r_temp); xbee.printf("Temt:%5.2f, ",((vo*8-6)/25)); xbee.printf("acc_x:%5.2f, ",(ax*33-1.65)/0.66); xbee.printf("acc_y:%5.2f, ",(ay*33-1.65)/0.66); xbee.printf("acc_z:%5.2f",(az*33-1.65)/0.66); xbee.printf("light:%5.2f",light); xbee.printf("\n\r"); wait(1.0); } // fclose(fp); }