This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/EK-TM4C1294XL: tm4c1294xl

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hello everybody,
i have the following problem, i want to output different values to a server. For this I used the example enet_io. The output works so far, but I want to output comma numbers (for example 3.1). I tried to change the variable "extern volatile unsigned long g_ulAnimSpeed" to "float g_ulAnimSpeed" or "double g_ulAnimSpeed" but without success. I guess the server always shows an address instead of the number. But this address does not match the address of the array variable.
I would be glad about any hint
Greetings Florian
  • Hi,

     There is some code that you can reference in <TivaWare_Installation>/examples/boards/ek-tm4c1294xl-boostxl-senshub/compdcm_mpu9150/compdcm_mpu9150.c file on how to convert a floating value to a decimal value. Check out the code starting at line 656. I think what you want is to break a floating value, i.e. 3.1 into a decimal portion and the fractional portion. In this case, the decimal portion will be 3 and the fractional portion will be 1. You will then use then usnprintf() to form a string that includes the decimal value + '.' + fractional value.  I will suggest you create a very simple project that play with this idea first and see if it works before you apply to your enet_io project.