Battery and SDcard Q

Dependencies:   mbed PowerControl SDFileSystem

Fork of HeptaBattery_SDFilesystem_Q by 智也 大野

main.cpp

Committer:
tomoya123
Date:
2016-12-13
Revision:
1:6d9166677466
Parent:
0:9eb94b338772

File content as of revision 1:6d9166677466:

#include "mbed.h"
#include "SDFileSystem.h"
#include "HeptaBattery.h"

Serial pc(USBTX,USBRX);//ピンアサイン読み込み、オブジェクトの生成                        



int main() {
    pc.baud(9600);
    float bt;
    char str[100];
    pc.printf("Hello world!\r\n");
    mkdir("/sd/mydir", 0777);
    printf("helloworld\r\n");
    FILE *fp = fopen("/sd/mydir/sdtest.txt","w");
    if(fp == NULL) {
        error("Could not open file for write\r\n");
    }
    for(int i=0;i<10;i++){
     //バッテリー電圧を取得してsdtest.txtに書き込み
     
     
    }
    fclose(fp);
    fp = fopen("/sd/mydir/sdtest.txt","r");
    for(int j=0;j<10;j++){     
    //バッテリー電圧を読みだしてPCに表示
       
    }
    fclose(fp); 
    printf("Goodbye!!\r\n");
}