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 workinQM_5thJan_azad by
Diff: main.cpp
- Revision:
- 65:d1b12729fcdc
- Parent:
- 63:55d32e7dcad7
- Child:
- 66:a5d2b8dc6b9e
- Child:
- 68:abeaa67d84f5
--- a/main.cpp Fri Oct 28 17:50:49 2016 +0000 +++ b/main.cpp Thu Nov 24 09:45:08 2016 +0000 @@ -279,7 +279,7 @@ //eps hw faults //uint8_t ACS_TR_Z_SW_STATUS; -DigitalOut ACS_TR_Z_ENABLE(PIN40,0); +DigitalOut ACS_TR_Z_ENABLE(PIN40,0); //SWITCH DigitalIn ACS_TR_Z_OC_FAULT(PIN91); DigitalIn ACS_TR_Z_FAULT(PIN89); //Driver IC fault int ACS_TR_Z_FAULT_COUNTER = 0; @@ -581,13 +581,13 @@ gyro_data[i] = actual_data.AngularSpeed_actual[i]*3.14159/180; } - int b_inclination = mag_data[2]/sqrt(mag_data[0]*mag_data[0]+mag_data[1]*mag_data[1]+mag_data[2]*mag_data[2]); + float b_inclination = mag_data[2]/sqrt(mag_data[0]*mag_data[0]+mag_data[1]*mag_data[1]+mag_data[2]*mag_data[2]); if(b_inclination <0) { b_inclination = (-1)*b_inclination; } - B_SCZ_ANGLE = (uint8_t)b_inclination; + B_SCZ_ANGLE = (uint8_t)(b_inclination*16); if( b_inclination >= 16) { B_SCZ_ANGLE = 0x0F;