gotta check ctrl algo - it gives negative value
Fork of BAE_hw_test1_3 by
Diff: main.cpp
- Revision:
- 6:1cdbda747f99
- Parent:
- 5:4199c0dfed33
- Child:
- 7:603c2a89effc
diff -r 4199c0dfed33 -r 1cdbda747f99 main.cpp --- a/main.cpp Thu Feb 05 22:05:29 2015 +0000 +++ b/main.cpp Fri Feb 06 18:26:46 2015 +0000 @@ -116,7 +116,14 @@ for(int i=3; i<6; i++) { printf("%f\t",mnm_data[i]); } - + for(int i = 0 ; i<3;i++) + { + omega[i] = mnm_data[i]; + } + for( int i = 3;i<6;i++) + { + mag_field[i-3] = mnm_data[i]; + } if(acs_pflag == 1) { moment = FUNC_ACS_CNTRLALGO(mag_field,omega); @@ -242,9 +249,9 @@ if( slave.receive()==1) { t2.stop(); - //t3.start(); + slave_status=slave.write(data,length); - //t3.stop(); + t3.stop(); } else if( slave.receive()==3 || slave.receive()==2) @@ -252,7 +259,7 @@ t2.stop(); //t3.start(); slave_status=slave.read(data,length); - //t3.stop(); + t3.stop(); } @@ -260,8 +267,8 @@ printf("\n\r%d\r",t2.read_us()); t2.reset(); - //printf("\n\r%d\r",t3.read_us()); - //t3.reset(); + printf("\n\r%d\r",t3.read_us()); + t3.reset(); } @@ -312,6 +319,7 @@ { t2.start(); + // t3.start(); ptr_t_i2c->signal_set(0x4);