<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=15967&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-08-09T13:43:07+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=15967&amp;mode</id>
<entry>
<author><name><![CDATA[matej1410]]></name></author>
<updated>2016-08-09T13:43:07+01:00</updated>
<published>2016-08-09T13:43:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165733#p165733</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165733#p165733"/>
<title type="html"><![CDATA[Re: Przerwanie od Timer0]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165733#p165733"><![CDATA[
Głupi błąd. Dziękuję<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1912">matej1410</a> — 9 sie 2016, o 13:43</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marhef]]></name></author>
<updated>2016-08-09T13:40:39+01:00</updated>
<published>2016-08-09T13:40:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165732#p165732</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165732#p165732"/>
<title type="html"><![CDATA[Re: Przerwanie od Timer0]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165732#p165732"><![CDATA[
Ponieważ zmienna licznik jest lokalna w funkcji main(), a wywołujesz ją poza tą funkcją.<br />Przenieś linijkę[syntax=c]volatile int licznik=0;[/syntax]przed funkcję (3 linijki do góry)<br /><br />EDIT: Kolega był pół sekundy szybszy<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=12752">Marhef</a> — 9 sie 2016, o 13:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[HomoChemicus]]></name></author>
<updated>2016-08-09T13:38:39+01:00</updated>
<published>2016-08-09T13:38:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165731#p165731</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165731#p165731"/>
<title type="html"><![CDATA[Re: Przerwanie od Timer0]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165731#p165731"><![CDATA[
Tu chodzi o zakres widoczności zmiennej. Twoja zmienna licznik jest widoczna tylko w main. Wyciągnij ją przed main i będzie ok.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=10470">HomoChemicus</a> — 9 sie 2016, o 13:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[matej1410]]></name></author>
<updated>2016-08-09T13:34:06+01:00</updated>
<published>2016-08-09T13:34:06+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165730#p165730</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165730#p165730"/>
<title type="html"><![CDATA[Przerwanie od Timer0]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15967&amp;p=165730#p165730"><![CDATA[
Witajcie.<br /><br />Co w tym kodzie jest nie tak?<br />Kompilator zwraca mi błąd, że:<br /> ../main.c:29:2: error: 'licznik' undeclared (first use in this function)<br /><br /><br /><br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />int main()<br />{<br />volatile int licznik=0;<br /><br />//DDRC=0x00;<br />//PORTC=0xFF;<br />DDRD=0xFF;<br /><br />TCCR0|= (1&lt;&lt;CS02); //preskaler 256<br />TIMSK |= 1&lt;&lt;TOIE0;<br />TCNT0=0;//włączenie przerwania od przepełnienia licznika<br />sei();<br />while(1);<br /><br />}<br /><br />ISR(TIMER0_OVF_vect)<br />{<br />TCNT0=0;<br />licznik++;<br /><br />if (licznik&gt;10)<br />{<br />PORTD=0xff;<br />_delay_ms(1000);<br />PORTD=0x00;<br />_delay_ms(1000);<br />licznik=0;<br />}<br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1912">matej1410</a> — 9 sie 2016, o 13:34</p><hr />
]]></content>
</entry>
</feed>