Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed PowerControl SDFileSystem
Fork of HeptaBattery_SDFilesystem_Q by
Revision 1:6d9166677466, committed 2016-12-13
- Comitter:
- tomoya123
- Date:
- Tue Dec 13 07:22:14 2016 +0000
- Parent:
- 0:9eb94b338772
- Commit message:
- Battery and SDcard Q
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9eb94b338772 -r 6d9166677466 main.cpp --- 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