Code to take GPS, Accelerometer and Compass readings and print to USB for data analysis.
Dependencies: CMPS03 FatFileSystemCpp GPS MMA7660 mbed C12832_lcd
Revision 7:2f5cc7f14269, committed 2014-05-07
- Comitter:
- Alex4475
- Date:
- Wed May 07 10:44:45 2014 +0000
- Parent:
- 6:c667497a588d
- Commit message:
- Final code cleaning and syntax.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed May 07 10:39:27 2014 +0000 +++ b/main.cpp Wed May 07 10:44:45 2014 +0000 @@ -40,17 +40,17 @@ error("Could not open directory!"); } //printf("\nTesting file write:\n"); - FILE *CompassFile = fopen( "/" FSNAME "/compass_file.txt", "w"); + FILE *CompassFile = fopen( "/" FSNAME "/CMP_file.txt", "w"); if ( CompassFile == NULL ) { error("Could not open compass file for write\n"); } - FILE *GPSFile = fopen("/" FSNAME "/gps_file.txt", "w"); + FILE *GPSFile = fopen("/" FSNAME "/GPS_file.txt", "w"); if ( GPSFile == NULL ) { error("Could not open GPS file for write\n"); } - FILE *AccelFile = fopen("/" FSNAME "/accel_file.txt", "w"); + FILE *AccelFile = fopen("/" FSNAME "/MMA_file.txt", "w"); if ( AccelFile == NULL ) { error("Could not open acceleration file for write\n"); @@ -58,7 +58,6 @@ if (MMA.testConnection()) connectionLed = 1; // check that MMA is connected and display on LED1 - pc.printf("Starting CMPS03 test...\n"); float refPoint = 1.0; float bearing; int i = 1; @@ -68,9 +67,10 @@ refPoint = compass.readBearing(); while(i == 1) { - CompassFile = fopen("/" FSNAME "/compass_file.txt", "a"); - GPSFile = fopen("/" FSNAME "/gps_file.txt", "a"); - AccelFile = fopen("/" FSNAME "/accel_file.txt", "a"); + CompassFile = fopen("/" FSNAME "/CMP_file.txt", "a"); + GPSFile = fopen("/" FSNAME "/GPS_file.txt", "a"); + AccelFile = fopen("/" FSNAME "/MMA_file.txt", "a"); + // GPS code if(gps.sample()) { @@ -86,7 +86,6 @@ } // Accelerometer code - ax=MMA.x(); // read accelerometer values ay=MMA.y(); az=MMA.z();