<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6641/printing-floating-point-numbers-to-uart</link><description>Hey everyone, 
 I&amp;#39;m trying to print floating point numbers to the UART to debug my application. I know the nrf51 is doing the operations correctly because if I convert the variable to an int I can print it correctly and I get (~)accurate values.
When</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 25 Apr 2015 12:19:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6641/printing-floating-point-numbers-to-uart" /><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23283?ContentTypeID=1</link><pubDate>Sat, 25 Apr 2015 12:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d827ddc9-69f0-4cbf-8e01-0e5d9f4aed64</guid><dc:creator>maxpaynner</dc:creator><description>&lt;p&gt;&lt;a href="http://www.quickmeme.com/img/b1/b1863ec001f174e2d9a3cc0ad89aad0cbf78ddd297256b891bd8ff4662f3f044.jpg"&gt;Thanks :) Tested and working!&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23282?ContentTypeID=1</link><pubDate>Sat, 25 Apr 2015 02:15:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:705c8f3a-9051-424d-8b3d-637d205a8e87</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;you also need this option &lt;code&gt;-u _printf_float&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23281?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2015 22:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3995c16-23e1-467b-88a4-96311a526762</guid><dc:creator>maxpaynner</dc:creator><description>&lt;p&gt;Okay, this is in my makefile:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# use newlib in nano version
LDFLAGS += --specs=nano.specs -lc -lnosys
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And still no floating point support. Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23280?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 14:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cd0e2dc-82f3-449b-ac39-549ae93b1401</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Follow &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;this blog&lt;/a&gt; for Eclipse based development&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23279?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 14:16:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4e79607-655d-432a-93d2-fa211e9d8d12</guid><dc:creator>maxpaynner</dc:creator><description>&lt;p&gt;I&amp;#39;m using both actually, never figured out how to get eclipse to compile for the nrf51 so I&amp;#39;m using my custom makefile that I call from eclipse using &amp;quot;external tools&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23278?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 13:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6a5cfe8-3d97-4702-bb73-c7ea2145588e</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Well, it depends on which development environment you use.  Each has different way to do it.  If you are using makefile with gcc then yes, follow that instruction.  If you are using Eclipse project, it is in linker settings...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23277?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 13:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cbb57a1-67d4-4cdc-a88c-8b0354a8a996</guid><dc:creator>maxpaynner</dc:creator><description>&lt;p&gt;Do I just have to follow what&amp;#39;s written here &lt;a href="https://devzone.nordicsemi.com/question/4740/how-to-get-rid-of-impure_data/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; to link with newlib-nano?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23276?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 11:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11bdbbb1-14d9-4e39-b527-1c719d820a9a</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Either link with floating point support.  newlib-nano has that option or you do it manually using integer.  Cast to int to printf integer part, then take the floating part multiply by 10, 100, 1000 depending on how many digits you want to keep.  Don&amp;#39;t forget to add .5 to round up.  Then print the int part again. For example 2 decimal points : multiply by 100.0 and printf format is &amp;quot;%d.%02d&amp;quot;, for 4 decimal point : multiply by 10000.0 using format &amp;quot;%d.%04d&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Printing floating point numbers to UART</title><link>https://devzone.nordicsemi.com/thread/23275?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2015 10:56:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aa39d02-d448-45eb-a101-e4cd12e392d4</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;You answered your question. Need to compile with Full Printf support. For IAR it is in General Options for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>