<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use and print out floating point with K60 and codewarrior in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468535#M28284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please check the attachment, it was modified from KL25' demo code, and can printf &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;floating point number&lt;/SPAN&gt; in 6 bit precision, also you can change it by adjusting the parameter-precision=n. !&lt;/P&gt;&lt;P&gt;Wish it can help you.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 May 2016 06:50:48 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2016-05-16T06:50:48Z</dc:date>
    <item>
      <title>Use and print out floating point with K60 and codewarrior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468534#M28283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the Kinetis K60 towerboard (PK60DN512Z) and codewarrior 10.5. I am running the i2c example code, which prints out the accelerometer measurements. I would like to convert that to floating point value. Does anybody know how? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 04:33:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468534#M28283</guid>
      <dc:creator>broccolee</dc:creator>
      <dc:date>2016-05-13T04:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Use and print out floating point with K60 and codewarrior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468535#M28284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please check the attachment, it was modified from KL25' demo code, and can printf &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;floating point number&lt;/SPAN&gt; in 6 bit precision, also you can change it by adjusting the parameter-precision=n. !&lt;/P&gt;&lt;P&gt;Wish it can help you.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 06:50:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468535#M28284</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-05-16T06:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use and print out floating point with K60 and codewarrior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468536#M28285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;Thanks for your help! I replaced everything in printf.c with what you sent, it works for the most part. However, it fails to print out negative floating points. See the screenshot below: (the values in the last column is the converted gravity values in floating point of the raw data, which is signed char in the third column, all negative values are displayed wrongly..). Any idea how I can troubleshoot this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58895iE68428F2CB9B78B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also attached my code for your review. It is actually example code for Kinetis K60 MCU, I modified it a little. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 17:49:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468536#M28285</guid>
      <dc:creator>broccolee</dc:creator>
      <dc:date>2016-05-16T17:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use and print out floating point with K60 and codewarrior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468537#M28286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm still investigating the printf.c file now, so I'd highly recommend that you can use the some software tricks to convert the negative float variable into the positive, then use the codes likes below to plus the flag "-".&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;printf("-%f\r\n", float variable);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 06:39:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468537#M28286</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-05-17T06:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Use and print out floating point with K60 and codewarrior</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468538#M28287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestions! Would prefer that printf does it automatically for me. This'll do for now. Please let me know when a proper fix is discovered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2016 16:17:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Use-and-print-out-floating-point-with-K60-and-codewarrior/m-p/468538#M28287</guid>
      <dc:creator>broccolee</dc:creator>
      <dc:date>2016-05-17T16:17:29Z</dc:date>
    </item>
  </channel>
</rss>

