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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-06-22T06:38:25+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=58&amp;t=18665&amp;mode</id>
<entry>
<author><name><![CDATA[wronski]]></name></author>
<updated>2017-06-22T06:38:25+01:00</updated>
<published>2017-06-22T06:38:25+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191056#p191056</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191056#p191056"/>
<title type="html"><![CDATA[Re: Matryca 4x4 zawsze działa ostatnia pozycja case]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191056#p191056"><![CDATA[
Witam. <br />Dobrze zauważyłeś, ale nie to nie był błąd. <br />Udało mi się w nocy zrobić.<br />Problem leżał dosyć dziwny. Po zmianie portów z np: PORTB = 0b10111111; na przesunięcia |=(1&lt;&lt;PBx) wszystko zadziałało.<br />Pozdrawiam<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=401">wronski</a> — 22 cze 2017, o 06:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bartex4815]]></name></author>
<updated>2017-06-21T22:07:59+01:00</updated>
<published>2017-06-21T22:07:59+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191047#p191047</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191047#p191047"/>
<title type="html"><![CDATA[Re: Matryca 4x4 zawsze działa ostatnia pozycja case]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191047#p191047"><![CDATA[
W tym głównym switch-u brakuje komend 'break',ma być tak jak w tych dwóch mniejszych w środku. <br />Więc wykonuje się wszystko poniżej case 2: <br />I rozumiem że w tym switch-u głównym zamiast '2' ma być zmienna 'i' z pętli. <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1531">bartex4815</a> — 21 cze 2017, o 22:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[wronski]]></name></author>
<updated>2017-06-21T20:27:57+01:00</updated>
<published>2017-06-21T20:27:57+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191039#p191039</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191039#p191039"/>
<title type="html"><![CDATA[Matryca 4x4 zawsze działa ostatnia pozycja case]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18665&amp;p=191039#p191039"><![CDATA[
Witam<br />Potrzebuję zrobić obsługę matrycową 4x4 ale no zasadzie poniższej (2x swich- chodzi o naukę swich).<br />Problem polega na tym, że działa tylko ostatnia instrukcja z pętli for.<br />Jestem początkujący i męczę się od dłuższego czasu.<br /><br /><br />[syntax=c]#define F_CPU 16000000<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#define LED1 (1&lt;&lt;PA7)<br />#define LED2 (1&lt;&lt;PA6)<br />#define LED3 (1&lt;&lt;PA5)<br />#define LED4 (1&lt;&lt;PA4)<br />#define LED5 (1&lt;&lt;PA3)<br />#define LED6 (1&lt;&lt;PA2)<br />#define LED7 (1&lt;&lt;PA1)<br />#define LED8 (1&lt;&lt;PA0)<br />#define LED1_ON PORTA &amp;= ~LED1<br />#define LED2_ON PORTA &amp;= ~LED2<br />#define LED3_ON PORTA &amp;= ~LED3<br />#define LED4_ON PORTA &amp;= ~LED4<br />#define LED5_ON PORTA &amp;= ~LED5<br />#define LED6_ON PORTA &amp;= ~LED6<br />#define LED7_ON PORTA &amp;= ~LED7<br />#define LED8_ON PORTA &amp;= ~LED8<br />#define LED_OFF PORTA = 0b11111111<br />#define LED_ON PORTA = 0b00000000<br /><br />int main(void)<br />{<br />DDRA = 0b11111111;<br />PORTA = 0b11111111;<br />DDRB = 0b11110000;<br />PORTB = 0b11111111;<br />while(1)<br />{<br />PORTB = 0b11111111;<br /><br /><br />for (int i = 1; i &lt; 5;i++)<br />{<br />_delay_ms(100);<br />switch(2)<br />{<br />case 1 : _delay_ms(5);<br />PORTB = 0b01111111;<br />switch(PINB)<br />{<br />case 0b01110111 : LED_OFF; LED8_ON; break;<br />case 0b01111011 : LED_OFF; LED7_ON; break;<br />case 0b01111101 : LED_OFF; LED8_ON;LED7_ON; break;<br />case 0b01111110 : LED_OFF; LED6_ON; break;<br />default:break;<br />};<br />case 2 : _delay_ms(5);<br />PORTB = 0b10111111;<br />switch(PINB)<br />{<br />case 0b10110111 : LED_OFF; LED7_ON; break;<br />case 0b10111011 : LED_OFF; LED6_ON;LED7_ON; break;<br />case 0b10111101 : LED_OFF; LED6_ON;LED7_ON;LED8_ON; break;<br />case 0b10111110 : LED_OFF; LED5_ON; break;<br /><br />};<br />default:break;<br />/*case 3 :_delay_ms(5);<br />PORTB = 0b11101111;<br />switch(PINB)<br />{<br />case 0b11010111 : LED_OFF; LED5_ON;LED8_ON; break;<br />case 0b11011011 : LED_OFF; LED5_ON;LED8_ON;LED7_ON; break;<br />case 0b11011101 : LED_OFF; LED5_ON;LED6_ON; break;<br />case 0b11011110 : LED_OFF; LED5_ON;LED6_ON;LED8_ON; break;<br />default:break;<br />};<br />case 4 : _delay_ms(5);<br />PORTB = 0b11101111;<br />switch(PINB)<br />{<br />case 0b11100111 : LED_OFF; LED5_ON;LED6_ON;LED7_ON; break;<br />case 0b11101011 : LED_OFF; LED5_ON;LED6_ON;LED7_ON;LED8_ON; break;<br />case 0b11101101 : LED_OFF; LED4_ON; break;<br />case 0b11101110 : LED_OFF; LED4_ON;LED8_ON;break;<br />default:break;<br />};*/<br />};<br /><br />}<br />}<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=401">wronski</a> — 21 cze 2017, o 20:27</p><hr />
]]></content>
</entry>
</feed>