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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-06-11T14:07:46+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=8&amp;t=7376&amp;mode</id>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T14:07:46+01:00</updated>
<published>2014-06-11T14:07:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84095#p84095</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84095#p84095"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84095#p84095"><![CDATA[
Czy o coś takiego chodziło:<br /><br />[syntax=c]int main(void)<br />{<br /><br /><br />lcd_init();<br /><br />char printbuf&#91;16&#93;= &quot;test&quot;;<br /><br /><br />lcd_locate(0,0);<br />lcd_str_P(PSTR(&quot;TEMP&quot;));<br />lcd_locate(0,5);<br />lcd_str(printbuf);<br /><br />lcd_locate(1,0);<br />lcd_str_P(PSTR(&quot;HUM&quot;));<br />lcd_locate(1,5);<br />lcd_str(printbuf);<br />printbuf&#91;6&#93; = '*';<br />printbuf&#91;7&#93; = 0;<br /><br /><br />while(1);[/syntax]<br /><br />to utworzyłem w projekcie w którym wyświetlacz wyświetlał poprawnie <br /><br /><a href="http://forum.atnel.pl/_obrazki/o/2203/564ee8fde59bfda868cd2564fdef209d.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2203/564ee8fde59bfda868cd2564fdef209d.jpg" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 14:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[majster]]></name></author>
<updated>2014-06-11T12:27:30+01:00</updated>
<published>2014-06-11T12:27:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84083#p84083</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84083#p84083"/>
<title type="html"><![CDATA[Re: Odp: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84083#p84083"><![CDATA[
[quote=&quot;Maverick&quot;]<br /><br />2. coś takiego<br />[syntax=c]lcd_locate(0,0);<br />lcd_str(&quot;Linia 1&quot;);<br />lcd_locate(1,2);<br />lcd_str(&quot;Linia 2&quot;);<br />lcd_locate(2,4);<br />lcd_str(&quot;Linia 3&quot;);<br />lcd_locate(3,6);<br />lcd_str(&quot;Linia 4&quot;);[/syntax]<br /><br />No ok a ad 2 teraz tak jak mirek pisal zdefiniuj znaki w pustym nowym projekcie i je wyswietl bo piszesz ze stringi sa poprawnoe wyswietlane to teraz potestuj ze znalami<br /><br />Wysłane z telefonu<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1628">majster</a> — 11 cze 2014, o 12:27</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T12:24:34+01:00</updated>
<published>2014-06-11T12:24:34+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84082#p84082</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84082#p84082"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84082#p84082"><![CDATA[
a no widzisz pan czyli powoli choć widzę w bólach zbliżamy się do babola <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> który gdzieś robisz ... bo skoro te przykłady działają to trzeba szukać po kolei gdzie albo inaczej &quot;CO&quot; u ciebie powoduje kiszkę<br /><br />[syntax=c]lcd_str_P( PSTR(&quot;TEMP&quot;) );<br />                                                lcd_locate(0,5); // &lt;------ zmiana lokacji<br />                                                lcd_str(printbuf);<br />                                                lcd_locate(0,18);<br />                                                lcd_str_P( PSTR(&quot;\x81&quot;&quot;C&quot;) );[/syntax]<br /><br />zrób tak - gdy masz ten &quot;test&quot; (bez tego wpisywania zera) i pokaż co się dzieje. Tyle tylko że takie kroki po kolei sam powinieneś wykonywać - żeby dojść - ZŁAPAĆ BUG'a który wciska ci do bufora te śmieci<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 12:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T12:14:47+01:00</updated>
<published>2014-06-11T12:14:47+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84081#p84081</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84081#p84081"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84081#p84081"><![CDATA[
1. Projekt 04_LCD z bluebooka działa poprawnie<br /><br /><a href="http://forum.atnel.pl/_obrazki/o/2203/3e40b54da9ca95884a2fc26b3174b310.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2203/3e40b54da9ca95884a2fc26b3174b310.jpg" alt="Obrazek" /></a><br /><br />2. coś takiego<br />[syntax=c]lcd_locate(0,0);<br />lcd_str(&quot;Linia 1&quot;);<br />lcd_locate(1,2);<br />lcd_str(&quot;Linia 2&quot;);<br />lcd_locate(2,4);<br />lcd_str(&quot;Linia 3&quot;);<br />lcd_locate(3,6);<br />lcd_str(&quot;Linia 4&quot;);[/syntax]<br /><br />też jest dobrze wyświetlane<br /><br />3. Tak w tamtym projekcie było LCD_CLS() po zdefiniowaniu znaków<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 12:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T11:22:42+01:00</updated>
<published>2014-06-11T11:22:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84072#p84072</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84072#p84072"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84072#p84072"><![CDATA[
wiesz co ? wywal ten cały kod tzn zrób inny projekt testowy bo przecież to jest coś ... hmmm no szkoda gadać i się bawić - no masz jakiś taki babol gdzieś zrobiony że nikt ci nie podpowie<br /><br />1. weź albo projekt z książki z Bluebooka wgraj i sprawdź czy działa dobrze ?<br /><br />2. weź zrób pustą pętlę główną i przed nią zainicjalizuj LCD , zdefiniuj kilka znaków i wyświetl byle co z locate'em<br /><br />3. zrobiłeś ten LCD_CLS() po zdefiniowaniu znaków ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 11:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T11:13:58+01:00</updated>
<published>2014-06-11T11:13:58+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84069#p84069</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84069#p84069"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84069#p84069"><![CDATA[
coś takiego<br /><br /><a href="http://forum.atnel.pl/_obrazki/o/2203/33e530f242e06517310b520041ce88bb.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2203/33e530f242e06517310b520041ce88bb.jpg" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 11:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T11:06:17+01:00</updated>
<published>2014-06-11T11:06:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84064#p84064</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84064#p84064"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84064#p84064"><![CDATA[
no i co się teraz wyświetla ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 11:06</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T11:04:27+01:00</updated>
<published>2014-06-11T11:04:27+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84062#p84062</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84062#p84062"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84062#p84062"><![CDATA[
Używam ATmega 168.<br />[syntax=c]int main(void)<br />{<br /><br />char printbuf&#91;16&#93; = &quot;test&quot;;<br />    lcd_init();<br /><br />        // załadowanie znaków do pamięci CGRAM<br /><br /><br />        lcd_defchar_P( 0x81, znak_stopien );<br />        lcd_defchar_P( 0x82, znak_procent );<br />        lcd_defchar_P( 0x83, znak_linia );<br />        lcd_cls();<br /><br /><br /><br />        //init interrupt<br />        sei();<br /><br /><br />        #if DHT_FLOAT == 1<br />        float temperature = 0;<br />        float humidity = 0;<br />        #endif<br /><br />        for (;;) {<br />        if(dht_gettemperaturehumidity(&amp;temperature, &amp;humidity) != -1) {<br /><br /><br />        #if DHT_FLOAT == 1<br />        dtostrf(temperature, 3, 1, &quot;test&quot;);<br />        #endif<br />        lcd_str_P( PSTR(&quot;TEMP&quot;) );<br />        lcd_locate(0,5); // &lt;------ zmiana lokacji<br />        lcd_str(printbuf);<br />        printbuf&#91;5&#93; = '*';<br />        printbuf&#91;6&#93; = 0;<br />        lcd_locate(0,18);<br />        lcd_str_P( PSTR(&quot;\x81&quot;&quot;C&quot;) );<br /><br /><br />        #if DHT_FLOAT == 1<br />        dtostrf(humidity,3,1,&quot;test&quot;);<br />        #endif<br />        lcd_locate(1,0);<br />        lcd_str_P( PSTR(&quot;HUMIDITY&quot;) );<br />        lcd_locate(1,12);<br />        printbuf&#91;5&#93;=0;<br />        lcd_str(printbuf);<br />        lcd_locate(1,19);<br />        lcd_str_P( PSTR(&quot;\x82&quot;) );<br /><br />        } else {<br /><br />        }<br /><br /><br />        }<br /><br /><br /><br />        _delay_ms(500);<br /><br /><br />        return 0;<br />        }[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 11:04</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T10:24:32+01:00</updated>
<published>2014-06-11T10:24:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84054#p84054</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84054#p84054"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84054#p84054"><![CDATA[
<div class="quotetitle">Maverick napisał(a):</div><div class="quotecontent"><br />Nie wiem, może popełniłem gdzieś błąd przy definicji własnych znaków<br /></div><br /><br />No ale zobacz - przesunąłeś wyświetlanie tablicy printbuf<br /><br />i specjalnie wpisujemy już w miesce 4-go znaku gwiazdkę, a w miejsce 5-go znaku wpisujemy ZERO czyli koniec stringa zatem powinno się wyświetlić np<br /><br />40.2*<br /><br />a u ciebie wyświetla się teraz na innej pozycj<br /><br />40.2┼<br /><br />i jakiś ptaszek .... czyli masz w tej tablicy jakiś ŚMIETNIK<br /><br />Jakiego procka ty używasz tak w ogóle ?<br />po co printbuf u ciebie ma aż 100 bajtów ??? skoro ładujesz do niego tylko po kilka znaków ?<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 1 minucie ]</span></strong><br /><br />pokaż ty kod po zmianach ale tylko ten w main bo tak to gadamy jak głuchy z garbatym. <br /><br />poza tym zdefiniuj sobie printbuf jako zmienną globalną<br /><br />[syntax=c]char printbuf&#91;16&#93; = &quot;test&quot;;[/syntax]<br /><br />i zrób wyświetlanie tak jak masz tylko bez napełniania pritbufa tym swoim dtorfem<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 2 minutach ]</span></strong><br /><br />popatrz, pokombinuj - zrozum ..... masz problem z wyświetlaniem stringa prawidłowo z bufora - a nie problem z definicją znaków<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 10:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T09:49:05+01:00</updated>
<published>2014-06-11T09:49:05+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84053#p84053</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84053#p84053"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84053#p84053"><![CDATA[
Nie wiem, może popełniłem gdzieś błąd przy definicji własnych znaków<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 09:49</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T09:33:23+01:00</updated>
<published>2014-06-11T09:33:23+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84050#p84050</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84050#p84050"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84050#p84050"><![CDATA[
Maverick --&gt; pokazujesz obrazek a jakie masz wnioski ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 09:33</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[nixie]]></name></author>
<updated>2014-06-11T09:14:08+01:00</updated>
<published>2014-06-11T09:14:08+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84046#p84046</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84046#p84046"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84046#p84046"><![CDATA[
Po ostatnim lcd_defchar_P daj jedno lcd_cls.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=358">nixie</a> — 11 cze 2014, o 09:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T08:36:41+01:00</updated>
<published>2014-06-11T08:36:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84044#p84044</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84044#p84044"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84044#p84044"><![CDATA[
<a href="http://forum.atnel.pl/_obrazki/o/2203/977c29fe615682f881853fb47a9c14a9.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2203/977c29fe615682f881853fb47a9c14a9.jpg" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 08:36</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-11T08:24:07+01:00</updated>
<published>2014-06-11T08:24:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84042#p84042</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84042#p84042"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84042#p84042"><![CDATA[
<div class="quotetitle">Maverick napisał(a):</div><div class="quotecontent"><br />Też nie pomogło<br /></div><br /><br />Nie chce mi się w to wierzyć - coś robisz źle albo źle testujesz ... <br /><br />zmień lokację tych liczb np:<br /><br />[syntax=c]lcd_str_P( PSTR(&quot;TEMP&quot;) );<br />                                                lcd_locate(0,5); // &lt;------ zmiana lokacji<br />                                                lcd_str(printbuff);<br />                                                printbuf&#91;5&#93; = '*';<br />                                                printbuf&#91;6&#93; = 0;<br />                                                lcd_locate(0,18);<br />                                                lcd_str_P( PSTR(&quot;\x81&quot;&quot;C&quot;) );[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 11 cze 2014, o 08:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-11T08:10:30+01:00</updated>
<published>2014-06-11T08:10:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84039#p84039</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84039#p84039"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84039#p84039"><![CDATA[
Też nie pomogło<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 11 cze 2014, o 08:10</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-10T23:13:29+01:00</updated>
<published>2014-06-10T23:13:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84027#p84027</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84027#p84027"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84027#p84027"><![CDATA[
Spróbuj przed każdym poleceniem:<br /><br />[syntax=c]lcd_str(printbuff);[/syntax]<br /><br />dać tak:<br /><br />[syntax=c]printbuf&#91;5&#93;=0;<br />lcd_str(printbuff);[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 10 cze 2014, o 23:13</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-10T22:24:02+01:00</updated>
<published>2014-06-10T22:24:02+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84022#p84022</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84022#p84022"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84022#p84022"><![CDATA[
Nic to nie pomogło<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 10 cze 2014, o 22:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Zaba]]></name></author>
<updated>2014-06-10T20:57:50+01:00</updated>
<published>2014-06-10T20:57:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84009#p84009</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84009#p84009"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84009#p84009"><![CDATA[
a zadeklaruj bufo printbuff jako zmienną globalną<br />powyżej funkcji main.<br />Jest możliwość że w tym buforze są jakieś śmieci i są wyświetlane<br />dlatego że nie jest zerowany automatycznie .<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1044">Zaba</a> — 10 cze 2014, o 20:57</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-10T20:30:49+01:00</updated>
<published>2014-06-10T20:30:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84001#p84001</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84001#p84001"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=84001#p84001"><![CDATA[
Nie pomogło<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 10 cze 2014, o 20:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[krish]]></name></author>
<updated>2014-06-10T20:23:36+01:00</updated>
<published>2014-06-10T20:23:36+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83998#p83998</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83998#p83998"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83998#p83998"><![CDATA[
A spróbuj tak:<br /><br />[syntax=c]lcd_locate(0,0);<br />lcd_str_P( PSTR(&quot;TEMPERATURE&quot;) );<br />lcd_locate(0,12);<br />lcd_str(printbuff);<br />lcd_locate(0,17);<br />lcd_str_P( PSTR(&quot; \x81&quot;&quot;C&quot;) );[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2273">krish</a> — 10 cze 2014, o 20:23</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-10T17:47:34+01:00</updated>
<published>2014-06-10T17:47:34+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83970#p83970</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83970#p83970"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83970#p83970"><![CDATA[
Przy zmianie kodu i wykorzystaniu itoa jest podobnie...<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 10 cze 2014, o 17:47</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2014-06-10T13:11:29+01:00</updated>
<published>2014-06-10T13:11:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83947#p83947</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83947#p83947"/>
<title type="html"><![CDATA[Re: Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83947#p83947"><![CDATA[
Tak na szybko - choć mogę się mylić bo nie mam teraz jak sprawdzić - prawdopodobnie źle się posługujesz funkcją dtostrf() <br /><br />No przecież nawet widać zależność wyraźną - że TYLKO w miejscach związanych z wyświetlaniem jej wyniku masz krzaki na LCD ...<br /><br />doczytaj o tej funkcji dokładniej albo ew użyj sprintf() ....<br /><br />albo w ogóle (nie wiem po co w ogóle używać floatów) ... przerób to na liczby całkowite ... tzn oczywiście wynik będziesz miał z przecinkiem .... popatrz sobie przykłady w Bluebooku jak pozbywać się floatów np rozdział o ADC a mieć jednocześnie wyniki z miejscami po przecinku<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 10 cze 2014, o 13:11</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Maverick]]></name></author>
<updated>2014-06-10T12:05:15+01:00</updated>
<published>2014-06-10T12:05:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83944#p83944</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83944#p83944"/>
<title type="html"><![CDATA[Drobny problem z kodem prośba o pomoc]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=7376&amp;p=83944#p83944"><![CDATA[
Witam!<br />Wykorzystuję biblioteki wyświetlacza LCD z niebieskiej książki. Mam zdefiniowanych likla własnych znaków m.in Ż. Korzystam z wyświetlacza 4x20.<br />Zdefiniowany jest tak w pliku lcd44780.h<br />#if ( (LCD_ROWS == 4) &amp;&amp; (LCD_COLS == 20) )<br />#define LCD_LINE1 0x00// adres 1 znaku 1 wiersza<br />#define LCD_LINE2 0x40// adres 1 znaku 2 wiersza<br />#define LCD_LINE3 0x14  // adres 1 znaku 3 wiersza<br />#define LCD_LINE4 0x54  // adres 1 znaku 4 wiersza<br />#endif<br /><br />Wyświetlacz wyświetla na razie wyniki pomiaru temperatury i wilgotności powietrza z czujnika DHT22.<br /><br />Kod dht22.h<br />[syntax=c]#ifndef DHT22_H_<br />#define DHT22_H_<br /><br />//setup port<br />#define DHT_DDR DDRD<br />#define DHT_PORT PORTD<br />#define DHT_PIN PIND<br />#define DHT_INPUTPIN PD7<br /><br /><br />#define DHT_TYPE DHT_DHT22<br /><br />//enable decimal precision (float)<br /><br />#if DHT_TYPE == DHT_DHT22<br />#define DHT_FLOAT 1<br />#endif<br /><br />//timeout retries<br />#define DHT_TIMEOUT 200<br /><br />//functions<br />#if DHT_FLOAT == 1<br />extern int8_t dht_gettemperature(float *temperature);<br />extern int8_t dht_gethumidity(float *humidity);<br />extern int8_t dht_gettemperaturehumidity(float *temperature, float *humidity);<br /><br />#endif<br /><br />#endif /* DHT22_H_ */[/syntax]<br /><br />Kod dht22.c<br />[syntax=c]#include &lt;stdio.h&gt;<br />#include &lt;string.h&gt;<br />#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br />#include &quot;dht22.h&quot;<br /><br />/*<br /> * get data from sensor<br /> */<br />#if DHT_FLOAT == 1<br />int8_t dht_getdata(float *temperature, float *humidity) {<br /><br />#endif<br />uint8_t bits&#91;5&#93;;<br />uint8_t i,j = 0;<br /><br />memset(bits, 0, sizeof(bits));<br /><br />//reset port<br />DHT_DDR |= (1&lt;&lt;DHT_INPUTPIN); //output<br />DHT_PORT |= (1&lt;&lt;DHT_INPUTPIN); //high<br />_delay_ms(100);<br /><br />//send request<br />DHT_PORT &amp;= ~(1&lt;&lt;DHT_INPUTPIN); //low<br /><br />#if DHT_TYPE == DHT_DHT22<br />_delay_us(500);<br />#endif<br />DHT_PORT |= (1&lt;&lt;DHT_INPUTPIN); //high<br />DHT_DDR &amp;= ~(1&lt;&lt;DHT_INPUTPIN); //input<br />_delay_us(40);<br /><br />//check start condition 1<br />if((DHT_PIN &amp; (1&lt;&lt;DHT_INPUTPIN))) {<br />return -1;<br />}<br />_delay_us(80);<br />//check start condition 2<br />if(!(DHT_PIN &amp; (1&lt;&lt;DHT_INPUTPIN))) {<br />return -1;<br />}<br />_delay_us(80);<br /><br />//read the data<br />uint16_t timeoutcounter = 0;<br />for (j=0; j&lt;5; j++) { //read 5 byte<br />uint8_t result=0;<br />for(i=0; i&lt;8; i++) {//read every bit<br />timeoutcounter = 0;<br />while(!(DHT_PIN &amp; (1&lt;&lt;DHT_INPUTPIN))) { //wait for an high input (non blocking)<br />timeoutcounter++;<br />if(timeoutcounter &gt; DHT_TIMEOUT) {<br />return -1; //timeout<br />}<br />}<br />_delay_us(30);<br />if(DHT_PIN &amp; (1&lt;&lt;DHT_INPUTPIN)) //if input is high after 30 us, get result<br />result |= (1&lt;&lt;(7-i));<br />timeoutcounter = 0;<br />while(DHT_PIN &amp; (1&lt;&lt;DHT_INPUTPIN)) { //wait until input get low (non blocking)<br />timeoutcounter++;<br />if(timeoutcounter &gt; DHT_TIMEOUT) {<br />return -1; //timeout<br />}<br />}<br />}<br />bits&#91;j&#93; = result;<br />}<br /><br />//reset port<br />DHT_DDR |= (1&lt;&lt;DHT_INPUTPIN); //output<br />DHT_PORT |= (1&lt;&lt;DHT_INPUTPIN); //low<br />_delay_ms(100);<br /><br />//check checksum<br />if ((uint8_t)(bits&#91;0&#93; + bits&#91;1&#93; + bits&#91;2&#93; + bits&#91;3&#93;) == bits&#91;4&#93;) {<br />//return temperature and humidity<br /><br />#if DHT_TYPE == DHT_DHT22<br />uint16_t rawhumidity = bits&#91;0&#93;&lt;&lt;8 | bits&#91;1&#93;;<br />uint16_t rawtemperature = bits&#91;2&#93;&lt;&lt;8 | bits&#91;3&#93;;<br />if(rawtemperature &amp; 0x8000) {<br />*temperature = (float)((rawtemperature &amp; 0x7FFF) / 10.0) * -1.0;<br />} else {<br />*temperature = (float)(rawtemperature)/10.0;<br />}<br />*humidity = (float)(rawhumidity)/10.0;<br />#endif<br />return 0;<br />}<br /><br />return -1;<br />}<br /><br />/*<br /> * get temperature<br /> */<br />#if DHT_FLOAT == 1<br />int8_t dht_gettemperature(float *temperature) {<br />float humidity = 0;<br />#endif<br />return dht_getdata(temperature, &amp;humidity);<br />}<br /><br />/*<br /> * get humidity<br /> */<br />#if DHT_FLOAT == 1<br />int8_t dht_gethumidity(float *humidity) {<br />float temperature = 0;<br />#endif<br />return dht_getdata(&amp;temperature, humidity);<br />}<br /><br />/*<br /> * get temperature and humidity<br /> */<br />#if DHT_FLOAT == 1<br />int8_t dht_gettemperaturehumidity(float *temperature, float *humidity) {<br />#endif<br />return dht_getdata(temperature, humidity);<br />}[/syntax]<br /><br />I main.c<br /><br />[syntax=c]#include &lt;avr/io.h&gt;<br /><br />#include &lt;avr/interrupt.h&gt;<br /><br />#include &lt;avr/pgmspace.h&gt;<br />#include &lt;avr/eeprom.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br />#include &quot;LCD/lcd44780.h&quot;<br /><br /><br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br /><br /><br /><br />#include &quot;DHT22/dht22.h&quot;<br /><br /><br />const uint8_t znak_Z&#91;&#93; PROGMEM = {31,1,2,31,8,16,31,32};<br />const uint8_t znak_stopien&#91;&#93; PROGMEM = {6,9,9,6,32,32,32,32};<br />const uint8_t znak_procent&#91;&#93; PROGMEM = {24,25,3,6,12,24,19,3};<br />const uint8_t znak_linia&#91;&#93; PROGMEM = {32,1,3,6,12,24,16,32};<br /><br /><br /><br />int main(void)<br />{<br /><br />        char printbuff&#91;100&#93;;<br />    lcd_init();<br /><br />        // załadowanie znaków do pamięci CGRAM<br /><br />        lcd_defchar_P(0x80, znak_Z);<br />        lcd_defchar_P(0x81, znak_stopien);<br />        lcd_defchar_P(0x82, znak_procent);<br />        lcd_defchar_P(0x83, znak_linia);<br /><br /><br />        <br />        lcd_locate(2,0);<br />        lcd_str_P( PSTR(&quot;PRESSURE&quot;) );<br />        lcd_locate(3,0);<br />        lcd_str_P( PSTR(&quot;WIND SPEED&quot;) );<br /><br />        // napis z pamięci FLASH<br />        <br />        lcd_locate(2,17);<br />        lcd_str_P( PSTR(&quot;hPa&quot;) );<br />        lcd_locate(3,17);<br />        lcd_str_P( PSTR(&quot;m&quot;&quot;\x83&quot;&quot;s&quot;) );<br />        <br /><br />        //init interrupt<br />        sei();<br /><br /><br />        #if DHT_FLOAT == 1<br />        float temperature = 0;<br />        float humidity = 0;<br />        #endif<br /><br />        for (;;) {<br />        if(dht_gettemperaturehumidity(&amp;temperature, &amp;humidity) != -1) {<br /><br /><br />        #if DHT_FLOAT == 1<br />        dtostrf(temperature, 2, 2, printbuff);<br />        #endif<br />        lcd_locate(0,0);<br />        lcd_str_P( PSTR(&quot;TEMPERATURE&quot;) );<br />        lcd_locate(0,12);<br />        lcd_str(printbuff);<br />        lcd_locate(0,18);<br />        lcd_str_P( PSTR(&quot;\x81&quot;&quot;C&quot;) );<br /><br /><br />        #if DHT_FLOAT == 1<br />        dtostrf(humidity, 2, 2, printbuff);<br />        #endif<br />        lcd_locate(1,0);<br />        lcd_str_P( PSTR(&quot;HUMIDITY&quot;) );<br />        lcd_locate(1,12);<br />        lcd_str(printbuff);<br />        lcd_locate(1,19);<br />        lcd_str_P( PSTR(&quot;\x82&quot;) );<br /><br />        } else {<br /><br />        }<br /><br /><br /><br />        _delay_ms(1500);<br />        }<br /><br />        return 0;<br />        }[/syntax]<br /><br /><br />I teraz ten problem:<br />zdarza mi się (właściwie cały czas po dodaniu jakiegoś napisu na wyświetlaczu) pojawiają mi się w kilku miejscach na wyświetlaczu zdefiniowane przeze mnie znaki<br /><a href="http://forum.atnel.pl/_obrazki/o/2203/5f62e62e8a5b58caf8f411df129b8484.jpg"  class="postlink"><img src="http://forum.atnel.pl/_obrazki/o/thumb/2203/5f62e62e8a5b58caf8f411df129b8484.jpg" alt="Obrazek" /></a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2203">Maverick</a> — 10 cze 2014, o 12:05</p><hr />
]]></content>
</entry>
</feed>