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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2018-02-08T18:04:16+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=63&amp;t=20172&amp;mode</id>
<entry>
<author><name><![CDATA[antyllus]]></name></author>
<updated>2018-02-08T18:04:16+01:00</updated>
<published>2018-02-08T18:04:16+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203539#p203539</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203539#p203539"/>
<title type="html"><![CDATA[Re: FLOAT]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203539#p203539"><![CDATA[
It works like a charm.<br /><br />Dziękuję.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18954">antyllus</a> — 8 lut 2018, o 18:04</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-02-08T06:48:05+01:00</updated>
<published>2018-02-08T06:48:05+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203508#p203508</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203508#p203508"/>
<title type="html"><![CDATA[Re: FLOAT]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203508#p203508"><![CDATA[
Masz w b4a funkcję<br /><br />Round2(3.1452567567878, 3)<br /><br />użyj jej<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 8 lut 2018, o 06:48</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[antyllus]]></name></author>
<updated>2018-02-08T06:37:53+01:00</updated>
<published>2018-02-08T06:37:53+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203507#p203507</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203507#p203507"/>
<title type="html"><![CDATA[FLOAT]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20172&amp;p=203507#p203507"><![CDATA[
Mam pytanie odnośnie zmiennej FLOAT w B4a.<br /><br />Wysyłam z uC po UDP coś takiego:<br /><br /> r0,g0,b0,w0,p0,o0,i0,f0,t15,a20.00,b19.06,c-1.38<br /><br />gdzie ostatnie trzy liczby to zmienne typu FLOAT (odczyt temperatury z trzech termometrów)<br /><br /><br />W b4a rozbieram to tak:<br /><br />[syntax=java]Dim msg As String<br />msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, &quot;UTF8&quot;)<br /><br />If msg.Length &gt; 10 Then<br />Dim nr1 As Int = msg.IndexOf(&quot;,&quot;)<br /><br />Dim nr2 As Int = msg.IndexOf2(&quot;,&quot;, nr1+1)<br />Dim nr3 As Int = msg.IndexOf2(&quot;,&quot;, nr2+1)<br />Dim nr4 As Int = msg.IndexOf2(&quot;,&quot;, nr3+1)<br />Dim nr5 As Int = msg.IndexOf2(&quot;,&quot;, nr4+1)<br />Dim nr6 As Int = msg.IndexOf2(&quot;,&quot;, nr5+1)<br />Dim nr7 As Int = msg.IndexOf2(&quot;,&quot;, nr6+1)<br />Dim nr8 As Int = msg.IndexOf2(&quot;,&quot;, nr7+1)<br />Dim nr9 As Int = msg.IndexOf2(&quot;,&quot;, nr8+1)<br />Dim nr10 As Int = msg.IndexOf2(&quot;,&quot;, nr9+1)<br />Dim nr11 As Int = msg.IndexOf2(&quot;,&quot;, nr10+1)<br /><br />menu.red = msg.SubString2(1,nr1)<br />menu.grn = msg.SubString2(nr1+2,nr2)<br />menu.blu = msg.SubString2(nr2+2,nr3)<br />menu.wht = msg.SubString2(nr3+2,nr4)<br />menu.relay1 = msg.SubString2(nr4+2,nr5)<br />menu.relay2 = msg.SubString2(nr5+2,nr6)<br />menu.relay3 = msg.SubString2(nr6+2,nr7)<br />menu.foto = msg.SubString2(nr7+2,nr8)<br />menu.temp = msg.SubString2(nr8+2,nr8+4)<br />menu.acttemp1 = msg.SubString2(nr9+2,nr9+6)<br />menu.acttemp2 = msg.SubString2(nr10+2,nr11)<br />menu.acttemp3 = msg.SubString2(nr11+2,nr11+6)<br />piec = msg.SubString(nr10+2)<br /><br />set = menu.temp<br />Label1.Text = menu.acttemp1 &amp; Chr(186) &amp; &quot;C&quot; &amp; CRLF<br />Label2.Text = menu.acttemp2 &amp; Chr(186) &amp; &quot;C&quot; &amp; CRLF<br />Label3.Text = menu.acttemp3 &amp; Chr(186) &amp; &quot;C&quot; &amp; CRLF<br />Label4.Text = menu.temp &amp; Chr(186) &amp; &quot;C&quot; &amp; CRLF<br />Label5.Text = menu.relay1<br />Label6.Text = menu.temp[/syntax]<br /><br />okazuje się, że nieważne czy użyję tego (czyli od przecinka do przecinka):<br />[syntax=java]menu.acttemp2 = msg.SubString2(nr10+2,nr11)[/syntax]<br /><br />czy tego(od przecinka + kolejne 4 znaki):<br />[syntax=java]menu.acttemp2 = msg.SubString2(nr10+2,nr11)[/syntax]<br /><br />to w &quot;edit tekstach&quot; dostaję dane np: 19,0599999990909090<br />chciałbym oczywiście otrzymywać float do 2 miejsc po przecinku.<br /><br />ma ktoś jakieś pomysły, albo źródło do którego można by mnie odesłać?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18954">antyllus</a> — 8 lut 2018, o 06:37</p><hr />
]]></content>
</entry>
</feed>