First release.
Dependencies: FXOS8700CQ SDFileSystem mbed
Final program
- Controling a robot by Bluetooth, it is capable of making 90° turns and move pre-defined distances.
Code by:
- Mayumi Hori
- Sarahí Morán
- Gerardo Carmona
Diff: my_libraries/sd_card.cpp
- Revision:
- 2:94059cb643be
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/my_libraries/sd_card.cpp Thu Oct 16 17:30:52 2014 +0000 @@ -0,0 +1,32 @@ +// ----- Libraries ------------------------------------------------------------------ +#include "mbed.h" +#include "sd_card.h" + +// ----- Constants ------------------------------------------------------------------ + + +// ----- I/O Pins ------------------------------------------------------------------- +SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd"); // MOSI, MISO, SCK, CS + +// ----- Others --------------------------------------------------------------------- +FILE *fp; + +// ----- Variables ------------------------------------------------------------------ +int lat_points[10], lon_points[10]; +int points_gps; + + +// ----- Functions ------------------------------------------------------------------ +void savefile_sd(){ + FILE *fp = fopen("/sd/gps_points.txt", "w"); + if (fp == 0){ + //printf("Could not open file\n"); + }else{ + for (int i = 0; i < points_gps; i++){ + fprintf(fp, "%f\t%f", lat_points[i], lon_points[i]); + fprintf(fp, "\r\n"); + } + } + fclose(fp); +} +