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 SDFileSystem_
Diff: main.cpp
- Revision:
- 40:16c2d6b97a92
- Parent:
- 39:75f7b67a5747
- Child:
- 41:43828af3765f
--- a/main.cpp Fri Sep 10 06:52:10 2021 +0000
+++ b/main.cpp Fri Sep 10 08:41:05 2021 +0000
@@ -146,8 +146,8 @@
//平均(/s)
if (newcount == 500) {
float asc = (float)as / 500.0f;
- //pc.printf("avarage(new) x:%2.2f,y:%2.2f,z:%2.2f,scaler=%2.2f,max:%2.2f\r\n",
- //(float)ax/500.0f*0.005,(float)ay/500.0f*0.005,(float)az/500.0f*0.005,(float)as/500.0f*0.005, (float)tmp_max*0.005);
+ pc.printf("avarage(new) x:%2.2f,y:%2.2f,z:%2.2f,scaler=%2.2f,max:%2.2f\r\n",
+ (float)ax/500.0f*0.005,(float)ay/500.0f*0.005,(float)az/500.0f*0.005,(float)as/500.0f*0.005, (float)tmp_max*0.005);
sprintf(stracc1,"%d,%d,%2.2f,%2.2f\r\n",timecount,time(NULL),asc*0.005,(float)tmp_max*0.005);
if((strlen(buffer1)+strlen(stracc1)) > DATA_SIZE) {
@@ -254,12 +254,13 @@
if(!fp1){
pc.printf("fp1 create file failed:%d\r\n",errno);
NVIC_SystemReset();
- }
+ }
fp2 = fopen(filename2,"ab");
if(!fp2){
pc.printf("fp2 create file failed:%d\r\n",errno);
NVIC_SystemReset();
}
+
pc.printf("Create New File:%d,%d",timecount,time(NULL));
}
@@ -302,6 +303,9 @@
pc.printf("fp1(%s) open failed errno:%d\r\n",filename1,errno);
//NVIC_SystemReset();
}
+ else{
+ pc.printf("fp1 fopen success\r\n");
+ }
retry++;
wait_ms(100);
}
@@ -312,6 +316,9 @@
pc.printf("fp2(%s) open failed errno:%d\r\n",filename2,errno);
//NVIC_SystemReset();
}
+ else{
+ pc.printf("fp2 fopen success\r\n");
+ }
retry++;
wait_ms(100);
}
@@ -321,7 +328,7 @@
//pc.printf("readEEPROM:0x%x\r\n",readEEPROMByte(i));
max_g |= readEEPROMByte(i) << 8*i;
}
- pc.printf("read max_g from eeprom:%d\r\n",max_g);
+ pc.printf("read max_g from eeprom:%2.2f\r\n",(float)max_g*0.005);
while(init) {
init = initLIS331();