<?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 Global variable in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527915#M705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xOrElse on Thu Jul 19 10:30:00 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have problem with global variable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Where to put global variable and how to declare it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.c document I put volatile int globala=0; and it's not recognized as global. When I'm in functions I cant use it, the debugger reports it as globala isn't defined. I have no idea what to do. I'm new, and this program is so confusing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help me&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. I used to program in C (in school), so basically I understand syntax. Main problem is where in lpcxpresso should I put global variable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:33:49 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:33:49Z</dc:date>
    <item>
      <title>Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527915#M705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xOrElse on Thu Jul 19 10:30:00 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have problem with global variable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Where to put global variable and how to declare it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.c document I put volatile int globala=0; and it's not recognized as global. When I'm in functions I cant use it, the debugger reports it as globala isn't defined. I have no idea what to do. I'm new, and this program is so confusing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help me&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. I used to program in C (in school), so basically I understand syntax. Main problem is where in lpcxpresso should I put global variable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527915#M705</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527916#M706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Thu Jul 19 10:46:16 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: xOrElse&lt;/STRONG&gt;&lt;BR /&gt;I used to program in C (in school), so basically I understand syntax.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think so :rolleyes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://en.wikipedia.org/wiki/Global_variable&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The C language does [COLOR=Red]not have a global keyword[/COLOR]. However, variables declared outside a function implicitly have a scope covering everything in the .c file or compilation unit containing its declaration. In a small program contained in a single file, such variables effectively have global scope. On the other hand, a variable that is required to have global-scope in a[COLOR=DarkOrange] multi-file project needs to be imported individually into each file using the extern keyword[/COLOR].&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;So don't forget to use&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
extern volatile int myglobal;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;in multi-file project if your global is defined in another file of your project :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's C, not LPCXpresso &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527916#M706</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527917#M707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xOrElse on Thu Jul 19 10:56:48 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It still doesn't work, I don't know what to do!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code, could you please tell me where to put extern variable?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527917#M707</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527918#M708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Thu Jul 19 11:14:51 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: xOrElse&lt;/STRONG&gt;&lt;BR /&gt;It still doesn't work...&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because that's nonsense &lt;SPAN class="lia-unicode-emoji" title=":winking_face:"&gt;&lt;LI-EMOJI id="lia_winking-face" title=":winking_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Define a global in gpio.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
volatile int crveni=0;
volatile int plavi=0;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;#2 Add externs in gpio.h&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
extern volatile int crveni;
extern volatile int plavi;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;Now all files which include gpio.h know that there are your globals crveni and plavi :):)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527918#M708</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527919#M709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xOrElse on Fri Jul 20 04:04:13 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;THANK YOU SOOOO MUCH!!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know maybe where (which site) could I learn syntax better? As you can see my knowledge isn't so impressive, I know something, but not very much.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527919#M709</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527920#M710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by elef on Fri Jul 20 04:08:15 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: xOrElse&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Do you know maybe where (which site) could I learn syntax better? As you can see my knowledge isn't so impressive, I know something, but not very much.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are thousands. Just google C syntax and go through a few websites till you find one you like.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527920#M710</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527921#M711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by ex-kayoda on Fri Jul 20 04:15:13 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Googling for "C tutorial" will show you about 601 million results (here) :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps &lt;/SPAN&gt;&lt;A href="http://"&gt;http://www.cprogramming.com/tutorial/c-tutorial.html&lt;/A&gt;&lt;SPAN&gt; ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527921#M711</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Global variable</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527922#M712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by xOrElse on Fri Jul 20 04:21:26 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Global-variable/m-p/527922#M712</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:33:53Z</dc:date>
    </item>
  </channel>
</rss>

