![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
GPS and IMU reading works
Dependencies: mbed Servo SDFileSystem
Diff: main.cpp
- Revision:
- 19:eef0e3ec32a0
- Parent:
- 18:9a30764847d2
- Child:
- 20:a820531c78bc
diff -r 9a30764847d2 -r eef0e3ec32a0 main.cpp --- a/main.cpp Fri Aug 28 07:49:06 2015 +0000 +++ b/main.cpp Fri Aug 28 08:04:57 2015 +0000 @@ -4,6 +4,7 @@ #include <vector> #include "Get.h" #include "Servo.h" +#include "SDFileSystem.h" using namespace std; #define MAX_IMU_SIZE 29 @@ -20,7 +21,7 @@ Serial GPS(p13, p14); // tx, rx Servo rudderServo(p25); Servo wingServo(p26); -//rudderservo = 0.5; +SDFileSystem sd(p5, p6, p7, p8, "sd");// mosi, miso, sck, cs char IMU_message[256]; int IMU_message_counter=0; @@ -232,6 +233,17 @@ targetServo=pos; } +int log_data_SD(){ + FILE *fp = fopen("/sd/dataLog/dataLog.txt", "w"); + if(fp == NULL) { + return 0; + }else{ + //Write all the useful data to the SD card + fprintf(fp, "Nya Pass~"); + fclose(fp); + return 1; + } +} int main() { IMU.baud(57600);