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_10thDec by
Diff: EPS.cpp
- Revision:
- 19:79e69017c855
- Parent:
- 17:fc782f7548c6
- Child:
- 20:949d13045431
--- a/EPS.cpp Sat May 14 11:19:13 2016 +0000 +++ b/EPS.cpp Sat Jun 04 11:29:13 2016 +0000 @@ -79,6 +79,7 @@ { actual_data.Batt_gauge_actual[1] = soc(); actual_data.Batt_voltage_actual = Batt_voltage.read()*3.3; //1 corresponds to 3.3 scaling factor + //actual_data.Batt_voltage_data = Batt_voltage.read();/*changed 1.0*/ FCTN_EPS_POWERMODE(actual_data.Batt_gauge_actual[1]); EPS_BATTERY_GAUGE_STATUS = 's'; //set EPS_BATTERY_GAUGE_STATUS } @@ -104,6 +105,8 @@ //...................................................HK...........................................// /*reading values*/ +uint16_t val_read; +float readval; void FCTN_HK_MAIN() { @@ -121,17 +124,29 @@ //collecting data for(Iteration=0; Iteration<16; Iteration++){ - + wait_ms(100); + readval=VoltageInput.read(); + wait_ms(10); actual_data.voltage_actual[Iteration]=VoltageInput.read(); + val_read=VoltageInput.read_u16(); + //wait_ms(80); + printf("\n\ractual reading voltage%f",readval); + printf("\n\ractual raw data vol %f ",actual_data.voltage_actual[Iteration]); + printf("\n\ractual raw data vol in uint16_t %x ",val_read); actual_data.current_actual[Iteration]=CurrentInput.read(); - - SelectLinea0=!(SelectLinea0); + readval=CurrentInput.read(); + printf("\n\ractual reading curr%f",readval); + //wait_ms(80); + + /* SelectLinea0=!(SelectLinea0); if(Iteration%2==1) SelectLinea1=!(SelectLinea1); if(Iteration%4==3) SelectLinea2=!(SelectLinea2); if(Iteration%8==7) SelectLinea3=!(SelectLinea3); + + */ int s0,s1,s2,s3; s0=SelectLineb0=SelectLinea0; s1=SelectLineb1=SelectLinea1;// changed to @@ -144,9 +159,9 @@ //_____________________________________________________________________________________________ -/// for(Iteration=0; Iteration<16; Iteration++) + for(Iteration=0; Iteration<16; Iteration++) { -/// printf("\n\rRaw data is for voltage %f",actual_data.voltage_actual[Iteration]); + printf("\n\rRaw data is for voltage %f",actual_data.voltage_actual[Iteration]); } //_____________________________________________________________________________________________ @@ -160,9 +175,9 @@ //_____________________________________________________________________________________________ -/// for(Iteration=0; Iteration<16; Iteration++) + for(Iteration=0; Iteration<16; Iteration++) { -/// printf("\n\ractual data is for voltage %f",actual_data.voltage_actual[Iteration]); + printf("\n\ractual data is for voltage %f",actual_data.voltage_actual[Iteration]); } //_____________________________________________________________________________________________ @@ -170,9 +185,9 @@ //_____________________________________________________________________________________________ -/// for(Iteration=0; Iteration<16; Iteration++) + for(Iteration=0; Iteration<16; Iteration++) { -/// printf("\n\rRAW data is for current %f",actual_data.current_actual[Iteration]); + printf("\n\rRAW data is for current %f",actual_data.current_actual[Iteration]); } //_____________________________________________________________________________________________ @@ -197,9 +212,9 @@ //_____________________________________________________________________________________________ -/// for(Iteration=0; Iteration<16; Iteration++) + for(Iteration=0; Iteration<16; Iteration++) { -/// printf("\n\ractual data is for current %f",actual_data.current_actual[Iteration]); + printf("\n\ractual data is for current %f",actual_data.current_actual[Iteration]); } //_____________________________________________________________________________________________ @@ -422,7 +437,7 @@ void FCTN_BATTERYGAUGE_MAIN(float Battery_parameters[4]) { - printf("\n\r battery gauge \n"); +/// printf("\n\r battery gauge \n"); float temp=30; //=Battery_temp (from temp sensor on battery board) //value of battery temperature in C currently given a dummy value. Should be updated everytime. tempCompensation(temp);