![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Battery and SDcard Q
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaBattery_SDFilesystem_Q by
Diff: main.cpp
- Revision:
- 1:6d9166677466
- Parent:
- 0:9eb94b338772
--- a/main.cpp Fri Dec 09 04:53:49 2016 +0000 +++ b/main.cpp Tue Dec 13 07:22:14 2016 +0000 @@ -1,13 +1,15 @@ #include "mbed.h" #include "SDFileSystem.h" #include "HeptaBattery.h" -Serial pc(USBTX,USBRX); - //ピンアサイン読み込み、オブジェクトの生成 + +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"); @@ -16,13 +18,16 @@ 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"); } \ No newline at end of file