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: FreescaleIAP mbed-rtos mbed
Fork of RAJANGAM_REVIEW_BAE_CODE by
Diff: ACS.cpp
- Revision:
- 41:5df2bed2157d
- Parent:
- 40:c2538d97e78b
diff -r c2538d97e78b -r 5df2bed2157d ACS.cpp
--- a/ACS.cpp Tue Jul 05 19:14:06 2016 +0000
+++ b/ACS.cpp Fri Jul 08 08:14:29 2016 +0000
@@ -81,12 +81,12 @@
uint8_t ACS_TR_Y_PWM; //*
uint8_t ACS_TR_Z_PWM; //*
//change
-uint16_t ACS_MM_X_COMSN = 1;
-uint16_t ACS_MM_Y_COMSN = 1;
-uint16_t ACS_MG_X_COMSN = 1;
-uint16_t ACS_MG_Y_COMSN = 1;
-uint16_t ACS_MM_Z_COMSN = 1;
-uint16_t ACS_MG_Z_COMSN = 1;
+uint16_t ACS_MM_X_COMSN = 0;
+uint16_t ACS_MM_Y_COMSN = 0;
+uint16_t ACS_MG_X_COMSN = 0;
+uint16_t ACS_MG_Y_COMSN = 0;
+uint16_t ACS_MM_Z_COMSN = 0;
+uint16_t ACS_MG_Z_COMSN = 0;
uint8_t float_to_uint8(float min,float max,float val)
{
@@ -557,19 +557,21 @@
int SENSOR_INIT()
{
-/// pc_acs.printf("Entered sensor init\n \r");
+ pc_acs.printf("Entered sensor init\n \r");
cmd[0]=RESETREQ;
cmd[1]=BIT_RESREQ;
ack = i2c.write(SLAVE_ADDR,cmd,2); //When 0x01 is written in reset request register Emulates a hard power down/power up
//wait_ms(575); //waiting for loading configuration file stored in EEPROM
-/// pc_acs.printf("ACK for reset is %d\r\n",ack); //waiting for loading configuration file stored in EEPROM
+ pc_acs.printf("ACK for reset is %d\r\n",ack); //waiting for loading configuration file stored in EEPROM
if( ack!=0)
{
+ wait_ms(100);
cmd[0]=RESETREQ;
cmd[1]=BIT_RESREQ;
- ack = i2c.write(SLAVE_ADDR,cmd,2); //repeat
+ ack = i2c.write(SLAVE_ADDR,cmd,2);
+ pc_acs.printf("ACK for reset for 2nd time is %d\r\n",ack); //repeat
if(ack !=0)
return 0;
}
@@ -758,8 +760,8 @@
int working=0;
-/// pc_acs.printf("Attitude sensor init called \n \r");
-/// pc_acs.printf("ATS Status is %x\n\n \r",(int)ACS_ATS_STATUS);
+ pc_acs.printf("Attitude sensor init called \n \r");
+ pc_acs.printf("ATS Status is %x\n\n \r",(int)ACS_ATS_STATUS);
if(((ACS_ATS_STATUS & 0xC0) != 0xC0)&&( (ACS_ATS_STATUS & 0xC0) != 0x80)) //Sensor1 status is not 10 or 11
@@ -770,8 +772,8 @@
if(working ==1)
{
ACS_ATS_STATUS = (ACS_ATS_STATUS&0x0F)|0x70;
-/// pc_acs.printf("ATS Status is %x\n\n \r",(int)ACS_ATS_STATUS); //Sensor 1 INIT successful
-/// pc_acs.printf("Attitude sensor init exitting. Init successful. Ideal case.Sensor 1\n \r");
+ pc_acs.printf("ATS Status is %x\n\n \r",(int)ACS_ATS_STATUS); //Sensor 1 INIT successful
+ pc_acs.printf("Attitude sensor init exitting. Init successful. Ideal case.Sensor 1\n \r");
ACS_INIT_STATUS = 0;
return 1;
}
@@ -892,8 +894,8 @@
ATS2_SENTRAL_STATUS_RGTR = (uint8_t)sentral;
}
-/// pc_acs.printf("Event Status is %x\n \r",event);
-/// pc_acs.printf("Sentral Status is %x\n \r",sentral);
+ pc_acs.printf("Event Status is %x\n \r",event);
+ pc_acs.printf("Sentral Status is %x\n \r",sentral);
@@ -1559,7 +1561,7 @@
{
g_err_flag_TR_x = 1;
}
- pc_acs.printf("DC for trx is %f \r \n",l_duty_cycle_x);
+ pc_acs.printf("\r\nDC for trx is %f \r \n",l_duty_cycle_x);
//------------------------------------- y-direction TR--------------------------------------//
