Not finished. This is my first attemp to make an autonomous vehicle for the Sparkfun Autonomous Competition (https://avc.sparkfun.com/) of June 2015.
Dependencies: FXOS8700CQ SDFileSystem mbed
Fork of AVC_Robot_Controled_Navigation by
- For my autonomous robot I will use a GPS, magnometer, accelerometer, and encoders.
- I control my robot with a remote control to save the GPS points (detect turns) using a xBee radio and save them to a file in a SD card.
my_libraries/sd_card.cpp
- Committer:
- gerardo_carmona
- Date:
- 2014-11-07
- Revision:
- 5:b384cf06de76
- Parent:
- 2:94059cb643be
File content as of revision 5:b384cf06de76:
// ----- 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); }