![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
gotta check ctrl algo - it gives negative value
Fork of BAE_hw_test1_3 by
Diff: main.cpp
- Revision:
- 5:4199c0dfed33
- Parent:
- 4:b33bc4267e0d
- Child:
- 6:1cdbda747f99
--- a/main.cpp Tue Feb 03 16:43:05 2015 +0000 +++ b/main.cpp Thu Feb 05 22:05:29 2015 +0000 @@ -6,6 +6,7 @@ #include "ACS.h" #include "fault.h" #include "slave.h" +#include "mnm.h" Serial pc(USBTX, USBRX); @@ -96,6 +97,7 @@ float *mag_field; float *omega; float *moment; + float *mnm_data; while(1) { Thread::signal_wait(0x1); @@ -104,7 +106,16 @@ mag_field= FUNC_ACS_MAG_EXEC(); //actual execution omega = FUNC_ACS_EXEC_GYR(); printf("\n\r gyr 1 value %f",omega[0]); - + mnm_data=EXECUTE_PNI(); //the angular velocity is stored in the first 3 values and magnetic field values in next 3 + printf("\n\rmnm gyro values\n"); //printing the angular velocity and magnetic field values + for(int i=0; i<3; i++) + { + printf("%f\t",mnm_data[i]); + } + printf("\n\r mnm mag values\n"); + for(int i=3; i<6; i++) { + printf("%f\t",mnm_data[i]); + } if(acs_pflag == 1) { @@ -336,7 +347,7 @@ data_ready=1; //temp = i2c_status; } - + //------------------------------------------------------------------------------------------------------------------------------------------------ //TELECOMMAND @@ -371,12 +382,12 @@ if(schedcount%1==0) { ptr_t_acs -> signal_set(0x1); - ptr_t_wdt -> signal_set(0x5); + ptr_t_wdt -> signal_set(0x5); } if(schedcount%2==0) { // ptr_t_fault -> signal_set(0x2); - ptr_t_hk_acq -> signal_set(0x2); + ptr_t_hk_acq -> signal_set(0x2); } if(schedcount%beacon_sc==0) @@ -384,7 +395,7 @@ if(beac_flag==0) { - ptr_t_bea -> signal_set(0x3); + ptr_t_bea -> signal_set(0x3); } } schedcount++; @@ -397,8 +408,12 @@ t1.start(); slave.address(0x20); //DRDY=0; + printf("\nahoy\n"); + INIT_PNI(); + FUNC_ACS_MAG_INIT(); FUNC_ACS_INIT_GYR(); + ptr_t_hk_acq = new Thread(T_HK_ACQ); ptr_t_acs = new Thread(T_ACS);