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

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

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=5663&amp;mode</id>
<entry>
<author><name><![CDATA[kurnachatka]]></name></author>
<updated>2014-01-24T20:03:44+01:00</updated>
<published>2014-01-24T20:03:44+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66502#p66502</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66502#p66502"/>
<title type="html"><![CDATA[Re: Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66502#p66502"><![CDATA[
<div class="quotetitle"><b>Quote:</b></div><div class="quotecontent"><br />Nie jestem pewien ale chyba jeszcze powinieneś<br />wyciąć te &quot;s&quot; ze zmiennej &quot;rx_temp&quot; i dopiero później poddać<br />konwersji do int<br /></div><br /><br />Albo umieścić ją na końcu.<br /><br />A tu krótki opis tej funkcji<br />&quot;Funkcja atoi jako argument pobiera liczbę w postaci ciągu znaków ASCII, a następnie zwraca jej wartość w formacie int. Liczbę może poprzedzać dowolną ilość białych znaków (spacje, tabulatory, itp.), oraz jej znak (plus (+) lub minus (-)). Funkcja atoi() kończy wczytywać znaki w momencie napotkania jakikowiek znaku który nie jest cyfrą.&quot;<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=930">kurnachatka</a> — 24 sty 2014, o 20:03</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antheri]]></name></author>
<updated>2014-01-24T20:03:04+01:00</updated>
<published>2014-01-24T20:03:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66501#p66501</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66501#p66501"/>
<title type="html"><![CDATA[Re: Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66501#p66501"><![CDATA[
Zaba<br />bardzo słuszna uwaga, dziękuję!<br /><br />[syntax=c]packet = Receive_Packet ( rx_tmp );<br />if (packet &gt; 0)<br />{<br />char *substring;<br />substring = &amp;rx_tmp&#91;1&#93;;<br /><br />if(strstr(rx_tmp, &quot;s&quot;))<br />{<br />serwo = atoi(substring);<br />uart_putint(serwo, 10);<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1994">antheri</a> — 24 sty 2014, o 20:03</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Zaba]]></name></author>
<updated>2014-01-24T19:40:31+01:00</updated>
<published>2014-01-24T19:40:31+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66497#p66497</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66497#p66497"/>
<title type="html"><![CDATA[Re: Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66497#p66497"><![CDATA[
Nie jestem pewien ale chyba jeszcze powinieneś<br />wyciąć te &quot;s&quot; ze zmiennej &quot;rx_temp&quot; i dopiero później poddać<br />konwersji do int<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1044">Zaba</a> — 24 sty 2014, o 19:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antheri]]></name></author>
<updated>2014-01-24T19:16:17+01:00</updated>
<published>2014-01-24T19:16:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66493#p66493</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66493#p66493"/>
<title type="html"><![CDATA[Re: Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66493#p66493"><![CDATA[
Tak, ma być oczywiście <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> ale to niestety tylko błąd w przepisywaniu na forum <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1994">antheri</a> — 24 sty 2014, o 19:16</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kurnachatka]]></name></author>
<updated>2014-01-24T19:14:04+01:00</updated>
<published>2014-01-24T19:14:04+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66492#p66492</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66492#p66492"/>
<title type="html"><![CDATA[Re: Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66492#p66492"><![CDATA[
[syntax=c]uart_putint(serwo, 10);[/syntax]<br /><br />A niema tu być czasem serwo1 zamiast serwo<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=930">kurnachatka</a> — 24 sty 2014, o 19:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antheri]]></name></author>
<updated>2014-01-24T19:16:28+01:00</updated>
<published>2014-01-24T19:06:05+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66490#p66490</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66490#p66490"/>
<title type="html"><![CDATA[Pytanie o konwersje zmiennej]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=5663&amp;p=66490#p66490"><![CDATA[
Witam!<br /><br />Na pierwszym AVR robię odczyty z trzech potencjometrów, pomiary &quot;ubieram&quot; w literkę aby były rozróżnialne z którego potencjometru zostały odczytane, np: <br /><br />1 potencjometr: 456 --- &gt; r465<br />2 potencjometr: 1003 ---&gt; s1003<br />2 potencjometr: 567 ---&gt; p567<br /><br />Według fragmentu kodu:<br />[syntax=c]char string&#91;4&#93;;<br />char label&#91;5&#93; = &quot;r&quot;; // lub s lub p<br />itoa(odczyt, string, 10);<br />strcat(label, string);[/syntax]<br /><br />I taką ramkę &quot;label&quot; pakuje w RFM73D, wysyłam i tym samym modułem odbieram na drugim procesorze. Funkcją strstr() rozpoznaję literkę w paczce i chcę wyciągnąć potem już tylko samą wartość. Funckja atoi zwraca 0.<br />Fragment kodu:<br />[syntax=c]packet = Receive_Packet ( rx_tmp );<br />if (packet &gt; 0)<br />{<br />        if(strstr(rx_tmp, &quot;s&quot;))<br />{<br />        serwo = atoi(rx_tmp);<br />uart_putint(serwo, 10);<br />}<br />}[/syntax]<br /><br />Co robię źle albo czego nie robię albo czego nie wiem albo jakiej funkcji nie znam która z C-stringa wyciąga same liczby?<br />Z góry dzięki!<br /><br />Dodam, że komunikacja odbywa sie bez zastrzeżeń.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1994">antheri</a> — 24 sty 2014, o 19:06</p><hr />
]]></content>
</entry>
</feed>