Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FXOS8700CQ SDFileSystem mbed
Fork of AVC_Robot_Controled_Navigation by
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);
+}
+
