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:
- 44:48fa8beb3b00
- Parent:
- 43:024421f7474c
- Child:
- 45:8be3cec8f1a6
--- a/main.cpp Wed Sep 15 05:10:59 2021 +0000
+++ b/main.cpp Thu Sep 16 02:31:24 2021 +0000
@@ -150,13 +150,11 @@
//スカラー値変換
scr = int_sqrt( tx*tx + ty*ty + tz*tz);// 195mg/digit
- //now_g = scr;
ax+= tx;
ay+= ty;
az+= tz;
as+= scr;
- //newcount++;
//pc.printf("%d,%d,x:%2.2f y:%2.2f,z:%2.2f scaler = %2.2f \r\n",timecount,time(NULL),(float)tx*0.005,(float)ty*0.005,(float)tz*0.005,(float)scr*0.005);
//pc.printf("new x:%d y:%d,z:%d scr=%d, max=%d\r\n",tx,ty,tz,scr,tmp_max);
@@ -179,10 +177,10 @@
}
//平均(/s)
- if (newcount == 400) {
- float asc = (float)as / 400.0f;
+ 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/400.0f*0.005,(float)ay/400.0f*0.005,(float)az/400.0f*0.005,(float)as/400.0f*0.005, (float)tmp_max*0.005);
+ (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) {
@@ -243,8 +241,8 @@
//pc.printf("%d,%d,old x:%d,y:%d,z:%d scaler = %d\r\n",timecount,time(NULL),tx,ty,tz,scr);
//sprintf(stracc2,"%d,%d,%d\r\n",timecount,time(NULL),scr);
//pc.printf("lis3dh:%s",stracc2);
- if(oldcount == 4000){
- float asc2 = (float)as2 / 400.0f;
+ if(oldcount == 5000){
+ float asc2 = (float)as2 / 500.0f;
//pc.printf("avarage(old) x:%2.2f,y:%2.2f,z:%2.2f,scaler=%2.2f,max:%2.2f\r\n",
//(float)ax2/500.0f*0.005,(float)ay2/500.0f*0.005,(float)az2/500.0f*0.005,(float)as2/500.0f*0.005, (float)tmp_max2*0.005);
sprintf(stracc2,"%d,%d,%2.2f,%2.2f\r\n",timecount,time(NULL),asc2*0.005,(float)tmp_max2*0.005);
@@ -606,7 +604,7 @@
oldcount++;
newcount++;
sub();
- wait_us(2500);
+ //wait_us(2500);
}
//pc.printf("Program End.\r\n");