![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
s
Dependencies: C12832_lcd CMPS03 GPS MMA7660 mbed
Revision 0:ed3bb00f66af, committed 2016-03-08
- Comitter:
- gegjackson
- Date:
- Tue Mar 08 14:50:55 2016 +0000
- Commit message:
- a
Changed in this revision
diff -r 000000000000 -r ed3bb00f66af C12832_lcd.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832_lcd.lib Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/dreschpe/code/C12832_lcd/#8f86576007d6
diff -r 000000000000 -r ed3bb00f66af CMPS03.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CMPS03.lib Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/Project-group-3/code/CMPS03/#1585ed4179f0
diff -r 000000000000 -r ed3bb00f66af GPS.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GPS.lib Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/GPS/#15611c7938a3
diff -r 000000000000 -r ed3bb00f66af MMA7660.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MMA7660/#36a163511e34
diff -r 000000000000 -r ed3bb00f66af main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,54 @@ +#include "mbed.h" +#include "CMPS03.h"//added +#include "MMA7660.h" +#include "stdio.h" //needed? +#include "GPS.h" + + +/*THIS FILE IS MADE TO RUN ON THE MBED. IT WILL TAKE ACCELEROMETER VALUES AND WRITE THEM +TO A TEXT FILE AND THEN A CONNECTED COMPUTER*/ +GPS gps(p13, p14);// which pins??? +CMPS03 compass(p9, p10, CMPS03_DEFAULT_I2C_ADDRESS);//added +DigitalOut myled(LED1); +MMA7660 MMA(p28, p27); // Accelerometer connections +float ax, ay, az; //allocations for the x, y, z values +Serial pc(USBTX,USBRX); // serial port +LocalFileSystem local("local"); // Create the local filesystem called "local" +int main() +{ + float data[100]; // three data arrays, with 100 entries + float data1[100]; + float data2[100]; + float data3[100]; + + + for (int i=0; i<100; i++) + { + ax=MMA.x(); //ax is the x value from the accelerometer. the *90 part is to get an angle + data[i] = ax ; //place the value of the accelerometer into the 1st array + ay=MMA.y(); + data1[i] = ay ; + az=MMA.z(); + data2[i] = az; + data3[i] = (compass.readBearing() / 10.0); + + + wait (0.1);// so all the results aren't taken as quickly as the mbed can process. total time = wait time * number of items in array + } + + FILE *fp = fopen("/local/values.txt", "w"); // Open "values.txt" + fprintf(fp,"Location is: %f , %f", gps.longitude, gps.latitude); + for (int i=0; i<100; i++) + { + fprintf(fp,"%i %f %f %f Bearing:%f \r\n ", i, data[i], data1[i], data2[i], data3[i]); //print all the data values to the file + } + fclose(fp); //save and close the file + + + + + +} + + +
diff -r 000000000000 -r ed3bb00f66af mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Mar 08 14:50:55 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb \ No newline at end of file