<?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=9404&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-11-24T10:13:03+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=9404&amp;mode</id>
<entry>
<author><name><![CDATA[Tannis]]></name></author>
<updated>2014-11-24T10:13:03+01:00</updated>
<published>2014-11-24T10:13:03+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=9404&amp;p=105702#p105702</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=9404&amp;p=105702#p105702"/>
<title type="html"><![CDATA[Sprawdzenie prostego kodu co do przerwan.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=9404&amp;p=105702#p105702"><![CDATA[
Witam, mam problem z przerwaniami, chciałbym aby ktoś sprawdził mój kod i określił czy jest on błędny a może trzeba coś w programie jeszcze ustawić? Za pomocą ISC ma odbierać albo cyfrę '1' lub '2' albo 'a' lub 'b' wysyłane z telefonu, jeżeli odbierze to włącza lub wyłącza diodkę, która jest podpięta pod jeden z pinów PORTC. A o to i kod: [syntax=c]main.c<br /><br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;stdlib.h&gt;<br />#include &lt;avr/pgmspace.h&gt;<br />#include &lt;string.h&gt;<br />#include &quot;MKUART/mkuart.h&quot;<br />int main()<br />{<br />    DDRC = 0xFF; // led<br />    PORTC = 0x00;<br /><br /><br />        uart_init( __UBRR );<br /><br /><br />    sei();                <br />        while(1)<br />        {<br /><br />        }<br />}<br /><br />ISR( USART_RXC_vect ) // bt<br />{<br />        char zmienna = UDR; // rejestr, w którym zapisujemy odebrany znak<br />        if (zmienna == 'a') // on<br />        {<br />               PORTC = 0x10;<br /><br />        }<br />        if (zmienna =='b') // off<br />        {<br />                PORTC = 0x11;<br /><br />        }<br /><br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=5915">Tannis</a> — 24 lis 2014, o 10:13</p><hr />
]]></content>
</entry>
</feed>