mbed final

Dependencies:   ADXL345_I2C BLE_API SDFileSystem mbed-rtos mbed nRF51822

Fork of 01 by Shuta Nakamae

Revision:
1:005a4d3ec64b
Parent:
0:07880269e91a
Child:
2:e103492f1a0b
--- a/main.cpp	Fri Dec 30 06:28:37 2016 +0000
+++ b/main.cpp	Tue Jan 10 10:54:21 2017 +0000
@@ -176,12 +176,20 @@
   ble.gap().setAdvertisingInterval(1000);*/
 }
  
+int init_file(void){
+ printf("before init 2\r\n");
+ wait(1);
+ fp = fopen("/sd/test.csv", "a");
+ fprintf(fp, "id, time\n");
+ fclose(fp);
+printf("end init \r\n");
+ wait(1);
  
+ return 0;
+ } 
  
  
 int main (void) {
-
-
 //------------------------------------------------------
 //加速度センサーの初期化
 
@@ -197,6 +205,8 @@
     
     ble.init(bleInitComplete);
     ble.setScanParams(GapScanningParams::SCAN_INTERVAL_MAX,GapScanningParams::SCAN_WINDOW_MAX,0);
+    printf("before init \r\n");
+    init_file();
  
     Thread t2(test_thread, (void *)"2");
     Thread t3(test_thread, (void *)"3");