I use the following code:
NRF_LOG_RAW_INFO("\t (%f %f %f)\r\n", fgx, fgy, fgz);
I get
(f f f)
What is missing here?
I use the following code:
NRF_LOG_RAW_INFO("\t (%f %f %f)\r\n", fgx, fgy, fgz);
I get
(f f f)
What is missing here?
Hi,
You need to use NRF_LOG_FLOAT_MARKER
and NRF_LOG_FLOAT()
to print floats, as described in the documentation:
NRF_LOG_INFO("My float number" NRF_LOG_FLOAT_MARKER "\r\n", NRF_LOG_FLOAT(f)))
Best regards,
Jørgen
Interesting! I've been using Segger Embedded Studio under Linux, configured using the instructions in devzone.nordicsemi.com/.../. I tried it in Keil in Windows as well as in GCC on Linux now, and it works in both cases, so it seems specific to Segger Embedded Studio. I'm not sure if it is a misconfiguration or if there's a bug in the snprintf they supply. Regardless, the SDK is fine, since SES isn't officially supported.
Interesting! I've been using Segger Embedded Studio under Linux, configured using the instructions in devzone.nordicsemi.com/.../. I tried it in Keil in Windows as well as in GCC on Linux now, and it works in both cases, so it seems specific to Segger Embedded Studio. I'm not sure if it is a misconfiguration or if there's a bug in the snprintf they supply. Regardless, the SDK is fine, since SES isn't officially supported.