<?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>LPC Microcontrollers中的主题 program cannot work without &amp;quot;printf&amp;quot;</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/program-cannot-work-without-quot-printf-quot/m-p/524647#M7283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wilbur He on Tue Apr 14 07:36:43 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all, I have met a problem which is I must put a printf inside the function, otherwise it won't work. I have tried many ways such as replace printf with a delay or some other commands. the function still didn't work. It only worked if i put a printf inside. (no matter what i printed). Here is the codes of my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while(test==1)// while main heart switch is activated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(time(NULL) &amp;gt;= duration) //when 15 seconds is up&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;finalcount = 4* count; //calculate total number of counts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;heartcheck(finalcount); //check if motor should be activated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(buffer,"%d",finalcount);//result to string for display&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(smsheart,"%d",finalcount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdClrScr();//clear to show new result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdPutString("Heartbeats/Min"); //upper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdSetXY(0,1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdPutString(buffer); //lower&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdSetXY(0,0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;count=0;//reset count for another loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;duration= (time(NULL)+15);// reset 15 seconds later&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else // if still not 15 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Read_Pulse();// read pulse&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:08:06 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:08:06Z</dc:date>
    <item>
      <title>program cannot work without "printf"</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/program-cannot-work-without-quot-printf-quot/m-p/524647#M7283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wilbur He on Tue Apr 14 07:36:43 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi all, I have met a problem which is I must put a printf inside the function, otherwise it won't work. I have tried many ways such as replace printf with a delay or some other commands. the function still didn't work. It only worked if i put a printf inside. (no matter what i printed). Here is the codes of my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while(test==1)// while main heart switch is activated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(time(NULL) &amp;gt;= duration) //when 15 seconds is up&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;finalcount = 4* count; //calculate total number of counts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;heartcheck(finalcount); //check if motor should be activated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(buffer,"%d",finalcount);//result to string for display&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;sprintf(smsheart,"%d",finalcount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdClrScr();//clear to show new result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdPutString("Heartbeats/Min"); //upper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdSetXY(0,1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdPutString(buffer); //lower&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lcdSetXY(0,0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;count=0;//reset count for another loop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;duration= (time(NULL)+15);// reset 15 seconds later&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else // if still not 15 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Read_Pulse();// read pulse&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:08:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/program-cannot-work-without-quot-printf-quot/m-p/524647#M7283</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: program cannot work without "printf"</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/program-cannot-work-without-quot-printf-quot/m-p/524648#M7284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wilbur He on Tue Apr 14 07:37:22 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone knows what the problem is? waiting online!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:08:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/program-cannot-work-without-quot-printf-quot/m-p/524648#M7284</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:08:07Z</dc:date>
    </item>
  </channel>
</rss>

