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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2018-03-14T22:06:28+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=47&amp;t=20413&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-03-14T22:06:28+01:00</updated>
<published>2018-03-14T22:06:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205576#p205576</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205576#p205576"/>
<title type="html"><![CDATA[Re: MENU z przykładu dla LCD ST7920  128x64]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205576#p205576"><![CDATA[
<div class="quotetitle">nebari napisał(a):</div><div class="quotecontent"><br />Z drugiej strony jak poznam schemat/konstrukcję budowania takiego menu to zawsze jakaś nauka na przyszłość<br /></div><br />Zaleta jest taka, że masz w 100% tę drugą stronę, czyli pełny kod źródłowy w C <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> a więc można analizować i przerabiać &quot;ile wlezie&quot; <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 14 mar 2018, o 22:06</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[nebari]]></name></author>
<updated>2018-03-14T22:00:41+01:00</updated>
<published>2018-03-14T22:00:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205575#p205575</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205575#p205575"/>
<title type="html"><![CDATA[Re: MENU z przykładu dla LCD ST7920  128x64]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205575#p205575"><![CDATA[
<div class="quotetitle">mirekk36 napisał(a):</div><div class="quotecontent"><br />może to nie andruino - ale rzuć może też okiem na to rozwiązanie <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><br /><br /><!-- m --><a class="postlink" href="http://mirekk36.blogspot.com/2018/02/mkmenu-oficjalny-start-plus-nowe.html" >http://mirekk36.blogspot.com/2018/02/mk ... -nowe.html</a><!-- m --><br /></div><br /><br />tak widziałem te materiały ale nie potrafię ich przenieść na arduino. Z drugiej strony jak poznam schemat/konstrukcję budowania takiego menu to zawsze jakaś nauka na przyszłość <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=18966">nebari</a> — 14 mar 2018, o 22:00</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[micky]]></name></author>
<updated>2018-03-14T21:56:17+01:00</updated>
<published>2018-03-14T21:56:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205574#p205574</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205574#p205574"/>
<title type="html"><![CDATA[Re: MENU z przykładu dla LCD ST7920  128x64]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205574#p205574"><![CDATA[
Nawet artykuł w nowej EP jest na ten temat <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=1546">micky</a> — 14 mar 2018, o 21:56</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-03-14T21:47:07+01:00</updated>
<published>2018-03-14T21:47:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205573#p205573</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205573#p205573"/>
<title type="html"><![CDATA[Re: MENU z przykładu dla LCD ST7920  128x64]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205573#p205573"><![CDATA[
może to nie andruino - ale rzuć może też okiem na to rozwiązanie <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><br /><br /><!-- m --><a class="postlink" href="http://mirekk36.blogspot.com/2018/02/mkmenu-oficjalny-start-plus-nowe.html" >http://mirekk36.blogspot.com/2018/02/mk ... -nowe.html</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 14 mar 2018, o 21:47</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[nebari]]></name></author>
<updated>2018-03-14T21:30:21+01:00</updated>
<published>2018-03-14T21:30:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205572#p205572</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205572#p205572"/>
<title type="html"><![CDATA[MENU z przykładu dla LCD ST7920  128x64]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20413&amp;p=205572#p205572"><![CDATA[
<img src="https://forum.atnel.pl/images/smilies/icon_cry.gif" alt=":cry:" title="Płacze" /> Witajcie<br />dogrzebałem się ostatnio do przykładowego skecha jaki jest dostępny dla LCD graficznego 128x64 na kontrolerze ST7920 i jest on po zmianie nagłówków (próba przerobienia na swoje potrzeby):<br />[syntax=c]#include &quot;U8glib.h&quot;<br />U8GLIB_ST7920_128X64_1X u8g(13, 12, 11);              // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 <br /><br />#define KEY_NONE 0<br />#define KEY_PREV 1<br />#define KEY_NEXT 2<br />#define KEY_SELECT 3<br />#define KEY_BACK 4<br /><br /><br />uint8_t uiKeyPrev = 7;<br />uint8_t uiKeyNext = 8;<br />uint8_t uiKeySelect = 9;<br />uint8_t uiKeyBack = 4;<br /><br />uint8_t uiKeyCodeFirst = KEY_NONE;<br />uint8_t uiKeyCodeSecond = KEY_NONE;<br />uint8_t uiKeyCode = KEY_NONE;<br /><br /><br />void uiSetup(void) {<br />  <br />  pinMode(uiKeyPrev, INPUT_PULLUP);               // ustawienie pinu pullup<br />  pinMode(uiKeyNext, INPUT_PULLUP);               // ustawienie pinu pullup<br />  pinMode(uiKeySelect, INPUT_PULLUP);             // ustawienie pinu pullup<br />  pinMode(uiKeyBack, INPUT_PULLUP);               // ustawienie pinu pullup<br />}<br /><br />void uiStep(void) {<br />  uiKeyCodeSecond = uiKeyCodeFirst;<br />  if ( digitalRead(uiKeyPrev) == LOW )<br />    uiKeyCodeFirst = KEY_PREV;<br />  else if ( digitalRead(uiKeyNext) == LOW )<br />    uiKeyCodeFirst = KEY_NEXT;<br />  else if ( digitalRead(uiKeySelect) == LOW )<br />    uiKeyCodeFirst = KEY_SELECT;<br />  else if ( digitalRead(uiKeyBack) == LOW )<br />    uiKeyCodeFirst = KEY_BACK;<br />  else <br />    uiKeyCodeFirst = KEY_NONE;<br />  <br />  if ( uiKeyCodeSecond == uiKeyCodeFirst )<br />    uiKeyCode = uiKeyCodeFirst;<br />  else<br />    uiKeyCode = KEY_NONE;<br />}<br /><br />#define MENU_ITEMS 5<br />const char *menu_strings&#91;MENU_ITEMS&#93; = { &quot;ZEGAR&quot;, &quot;TWARDOSC HK&quot;, &quot;LAMPA&quot;, &quot;WIATRAK&quot;, &quot;WYJSCIE&quot; };<br /><br />uint8_t menu_current = 0;<br />uint8_t menu_redraw_required = 0;<br />uint8_t last_key_code = KEY_NONE;<br /><br /><br />void drawMenu(void) {<br />  uint8_t i, h;<br />  u8g_uint_t w, d;<br /><br />  u8g.setFont(u8g_font_6x13);<br />  u8g.setFontRefHeightText();<br />  u8g.setFontPosTop();<br />  <br />  h = u8g.getFontAscent()-u8g.getFontDescent();<br />  w = u8g.getWidth();<br />  for( i = 0; i &lt; MENU_ITEMS; i++ ) {<br />    d = (w-u8g.getStrWidth(menu_strings&#91;i&#93;))/2;<br />    u8g.setDefaultForegroundColor();<br />    if ( i == menu_current ) {<br />      u8g.drawBox(0, i*h+1, w, h);<br />      u8g.setDefaultBackgroundColor();<br />    }<br />    u8g.drawStr(d, i*h, menu_strings&#91;i&#93;);<br />  }<br />}<br /><br />void updateMenu(void) {<br />  if ( uiKeyCode != KEY_NONE &amp;&amp; last_key_code == uiKeyCode ) {<br />    return;<br />  }<br />  last_key_code = uiKeyCode;<br />  <br />  switch ( uiKeyCode ) {<br />    case KEY_NEXT:<br />      menu_current++;<br />      if ( menu_current &gt;= MENU_ITEMS )<br />        menu_current = 0;<br />      menu_redraw_required = 1;<br />      break;<br />    case KEY_PREV:<br />      if ( menu_current == 0 )<br />        menu_current = MENU_ITEMS;<br />      menu_current--;<br />      menu_redraw_required = 1;<br />      break;<br />  }<br />}<br /><br /><br />void setup() {<br />  // rotate screen, if required<br />  // u8g.setRot180();<br />  <br />  uiSetup();                                // setup key detection and debounce algorithm<br />  menu_redraw_required = 1;     // force initial redraw<br />}<br /><br />void loop() {  <br /><br />  uiStep();                                     // check for key press<br />    <br />  if (  menu_redraw_required != 0 ) {<br />    u8g.firstPage();<br />    do  {<br />      drawMenu();<br />    } while( u8g.nextPage() );<br />    menu_redraw_required = 0;<br />  }<br /><br />  updateMenu();                            // update menu bar<br />  <br />}[/syntax]<br /><br />Jako, że jest to tylko jakiś przykład nie zawiera on pod poziomów. Zdaję sobie sprawę, że dla Was jest to pewnie śmieszy problem ale mam kłopot bo nigdzie na sieci nie ma wytłumaczenia jak konstruować w arduino menu (przynajmniej mi nie udało się znaleźć). W czym mam problem - otóż zależy mi na rozbudowaniu powyższego menu do takiej konstrukcji:<br /><br />[syntax=c]// <br />------------------- SCHEMAT NAWIGACJI MENU -------------------------------<br />// MENU:<br />// ZEGAR:         - &gt; GODZINA     00:00        <br />//                       KONIEC<br />//<br />// TWARDOŚĆ KH:   - &gt; 0 - 20     (do wyboru z zakresu)<br />//                        KONIEC<br />//<br />// LAMPA:         - &gt; GODZINA START 00:00<br />//                         GODZINA STOP  00:00<br />//                         MANUAL:  (0-255) bezpośrednie rozjaśnianie i ściemnianie lampy<br />//                         KONIEC<br />//<br />// WIATRAK:       - &gt; TEMPERATURA 20-30<br />//                           HISTEREZA 0.0-1.0 (w kroku co 0.1)<br />//                           KONIEC<br />//<br />// WYJŚCIE  (z menu do panelu głównego)<br />//<br />//-------------------------------[/syntax]<br />samo zaś wyświetlanie na ekranie wyglądało by: [syntax=c]MENU:<br />------------------------------------------<br />    ZEGAR<br />    TWARDOSC KH<br />-&gt;  LAMPA<br />    WIATRAK<br />    WYJSCIE<br />    KONIEC[/syntax]<br />[syntax=c]LAMPA:<br />--------------------------------------<br />-&gt;  GODZINA START<br />    GODZINA STOP<br />    MANUAL<br />    KONIEC[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18966">nebari</a> — 14 mar 2018, o 21:30</p><hr />
]]></content>
</entry>
</feed>