cancel
Showing results for 
Search instead for 
Did you mean: 

APP_LOG print float to serial

FPicc.1
Senior

Hi, I'm using the APP_LOG function to print data to serial. Here's how i do it:

APP_LOG(TS_OFF, VLEVEL_L, "%d,%d,%d,%d,%d,", front_brake_pressure, rear_left_wheel_speed, rear_right_wheel_speed, front_left_wheel_speed, front_right_wheel_speed);
APP_LOG(TS_OFF, VLEVEL_L, "%d,%d,%d,%d,%f,%f,%f\n", inverter_fail, bms_fail, imd_fail, bspd_fail, latitude, longitude, altitude);
APP_LOG(TS_OFF, VLEVEL_L, "\n\r");

But for some reason I can only print int variables, why float doesn't work? And how can I print float variables aswell?

Thanks in advance!

1 REPLY 1

>> .. why float doesn't work? 

Not enabled,or limited/restricted library employed to reduce firmware foot print. Review project meta-data / settings.

Could make your own dtoa() / ftoa() implementation, or scale numbers to provide visibility desired.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..