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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-05-21T21:30:43+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=7134&amp;mode</id>
<entry>
<author><name><![CDATA[kuba.user]]></name></author>
<updated>2014-05-21T21:30:43+01:00</updated>
<published>2014-05-21T21:30:43+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=82042#p82042</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=82042#p82042"/>
<title type="html"><![CDATA[Re: Menu wyboru- microswitch]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=82042#p82042"><![CDATA[
microswitch.h<br />[syntax=c]* microswitch.h<br /><br /><br />#ifndef MICROSWITH_H_<br />#define MICROSWITH_H_<br /><br />#define KEY_1 (1&lt;&lt;PC4)<br />#define KEY_2 (1&lt;&lt;PC3)<br />#define KEY_3 (1&lt;&lt;PC2)<br />#define KEY_1_DOWN !(PINC &amp; KEY_1)<br />#define KEY_2_DOWN !(PINC &amp; KEY_2)<br />#define KEY_3_DOWN !(PINC &amp; KEY_3)<br /><br />typedef struct {<br />int what_was;<br />int what_is;<br />int state_was;<br />int state_is;<br />}button;<br /><br />void button_init();<br />void bcheck1();<br />void bcheck2();<br />void bchech3();<br /><br />#endif /* MICROSWITH_H_ */[/syntax]<br /><br /><br />microswitch.c<br /><br />[syntax=c]microswitch.c<br /><br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &quot;microswith.h&quot;<br /><br />button button_1;<br />button button_2;<br />button button_3;<br />uint8_t keyboard_state;<br /><br />void button_init(){<br />/*ustawienie pinów na wejcie*/<br />DDRC &amp;= KEY_1;<br />DDRC &amp;= KEY_2;<br />DDRC &amp;= KEY_3;<br />/*podciagniecie do pinu do VCC*/<br />PORTC |= KEY_1;<br />PORTC |= KEY_2;<br />PORTC |= KEY_3;<br />}<br /><br />void bcheck1(){<br />if(KEY_1_DOWN){<br />_delay_ms(80);<br />if(KEY_1_DOWN){<br />button_1.what_is = 1;<br />if(button_1.what_was == 0){<br />button_1.what_was = 1;<br />}<br />else{<br />button_1.what_is = 0;<br />if(button_1.what_was == 1 &amp;&amp; button_1.what_is == 0 ){<br />if(button_1.state_is == 3){<br />button_1.state_is =1;<br />button_1.state_was =3;<br />}<br />else{<br />button_1.state_was = button_1.state_is;<br />button_1.state_is++;<br />}<br />button_1.state_was = 0;<br />}<br />}<br />}<br />}<br />}<br /><br />void bcheck2(){<br />if(KEY_2_DOWN){<br />_delay_ms(80);<br />if(KEY_2_DOWN){<br />button_2.what_is = 1;<br />if(button_2.what_was == 0){<br />button_2.what_was = 1;<br />}<br />else{<br />button_2.what_is = 0;<br />if(button_2.what_was == 1 &amp;&amp; button_2.what_is == 0 ){<br />if(button_2.state_is == 3){<br />button_2.state_is =1;<br />button_2.state_was =3;<br />}<br />else{<br />button_2.state_was = button_2.state_is;<br />button_2.state_is++;<br />}<br />button_2.state_was = 0;<br />}<br />}<br />}<br />}<br />}<br /><br />void bcheck3(){<br />if(KEY_3_DOWN){<br />_delay_ms(80);<br />if(KEY_3_DOWN){<br />button_3.what_is = 1;<br />if(button_3.what_was == 0){<br />button_3.what_was = 1;<br />}<br />else{<br />button_3.what_is = 0;<br />if(button_3.what_was == 1 &amp;&amp; button_3.what_is == 0 ){<br />if(button_3.state_is == 3){<br />button_3.state_is =1;<br />button_3.state_was =3;<br />}<br />else{<br />button_3.state_was = button_3.state_is;<br />button_3.state_is++;<br />}<br />button_3.state_was = 0;<br />}<br />}<br />}<br />}<br />}[/syntax]<br /><br /><br />czy mniej więcej o to chodzi?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3564">kuba.user</a> — 21 maja 2014, o 21:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[gumeni]]></name></author>
<updated>2014-05-20T20:48:50+01:00</updated>
<published>2014-05-20T20:48:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81874#p81874</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81874#p81874"/>
<title type="html"><![CDATA[Re: Menu wyboru- microswitch]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81874#p81874"><![CDATA[
Ogólnie to jakoś dziwnie pomieszały się dwa tematy. Kolega <strong>lemurek</strong> odpowiadał na temat:  &quot;Tytuł: Re: Eclipse błąd składni&quot;. Wracając do tematu czy kolega <strong>kuba.user</strong> ma już jakiś kod? Jeśli tak to proszę o umieszczenie go tutaj.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3088">gumeni</a> — 20 maja 2014, o 20:48</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kicajek]]></name></author>
<updated>2014-05-20T20:23:07+01:00</updated>
<published>2014-05-20T20:23:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81869#p81869</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81869#p81869"/>
<title type="html"><![CDATA[Re: Menu wyboru- microswitch]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81869#p81869"><![CDATA[
Witam<br /><div class="quotetitle">lemurek napisał(a):</div><div class="quotecontent"><br />W moim przypadku pomaga zmiana typu procesora na inny<br /></div><br />...ale kol.<strong>kuba.user</strong> chyba chodziło o coś innego; może napisze dokładniej, ale tu chyba chodzi o miernik który ma jakieś tam opcje pomiaru.<br /><br />Pozdr.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=826">kicajek</a> — 20 maja 2014, o 20:23</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[lemurek]]></name></author>
<updated>2014-05-19T16:12:22+01:00</updated>
<published>2014-05-19T16:12:22+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81734#p81734</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81734#p81734"/>
<title type="html"><![CDATA[Re: Eclipse błąd składni]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81734#p81734"><![CDATA[
W moim przypadku pomaga zmiana typu procesora na inny zatwierdzenie a potem powrót do właściwego. Oczywiście pamiętać należy o opcji clean ...<br /><br />Wysłane z mojego IdeaTabA1000-F przy użyciu Tapatalka<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=776">lemurek</a> — 19 maja 2014, o 16:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kuba.user]]></name></author>
<updated>2014-05-19T23:05:05+01:00</updated>
<published>2014-05-19T13:31:38+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81719#p81719</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81719#p81719"/>
<title type="html"><![CDATA[Menu wyboru- microswitch]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7134&amp;p=81719#p81719"><![CDATA[
mam pytanie, czy chcąc zrobić woltomierz z możliwością wyboru metody pomiaru, oraz dla pomiaru ciągłego móc modyfikować liczbę próbek do uśredniania, muszę sprawdzać za każdym razem oba przyciski i w zależności od tego w jakiej są pozycji (czy były/są wciśnięte) dokonywać ustawień, czy jest na to mniej skomplikowana metoda?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3564">kuba.user</a> — 19 maja 2014, o 13:31</p><hr />
]]></content>
</entry>
</feed>