Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

///LOGGER HERE///

sprintf(tx_buffer2,"%1d %1d %1d %3d %5d %5.1f


%6.2f %6.2f %5.1f %5.1f %5.1f %5.1f %6.2f "
,flag_can_ivc
,flag_can_cont
,flag_can_bms, //flag can
errorCode
,(rpm / 4)
,(float)(motorCurrent*0.1)
,(float)(controllerTemperature*0.01)
,(float)(d_check_pwr*0.01)
,(float)(d_battCurrentController*0.1)
,(float)(totalVoltController*0.1)
,(float)(dm_iq_set*0.1) //cont param
,(float) (motorCurrent2*0.1)
,(float)(motor_temp*0.01)

); //temp Ext
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),500);

#ifdef USE_96S
sprintf(tx_buffer2,"%1d %.2f %5.1f %5.3f %6.2f
"
,BMS_errorCode
,(float)(packSOC)/10.0
,(float)(totalVolt*0.0015)
,((float)lowestVolt*0.0015)
,(float) Curr);
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),300);

for(int a=1;a<48;a+=2)
{
sprintf(tx_buffer2,"%5.3f ",(float)
((voltage[a]<<8 | voltage[a+1])*0.0015));
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),100);
}
for(int a=1;a<48;a+=2)
{
sprintf(tx_buffer2,"%5.3f ",(float)
((voltage_2[a]<<8 | voltage_2[a+1])*0.0015));
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),100);
}
for(int a=1;a<48;a+=2)
{
sprintf(tx_buffer2,"%5.3f ",(float)
((voltage_3[a]<<8 | voltage_3[a+1])*0.0015));
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),100);
}
// for(int a=1;a<48;a+=2)
// {
// sprintf(tx_buffer2,"%5.3f ",(float)
((voltage_4[a]<<8 | voltage_4[a+1])*0.0015));
// HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),100);
// }
sprintf(tx_buffer2,"%5.3f %5.3f %5.3f %5.3f
%d\n\r"
,((float)(temperature[0])*0.01)//
TemperatureBatt 1
,((float)(temperature[4])*0.01)//
TemperatureBatt 2
,((float)(temperature[3])*0.01)// Temperature
Board
,((float)(temperature[1])*0.01)// Temperature
Board
, power_safe);
HAL_UART_Transmit(&huart1, (uint8_t
*)tx_buffer2, strlen(tx_buffer2),300);
osDelay(500);

You might also like