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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-07-09T15:51:28+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=46&amp;t=15702&amp;mode</id>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2016-07-09T15:51:28+01:00</updated>
<published>2016-07-09T15:51:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163735#p163735</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163735#p163735"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163735#p163735"><![CDATA[
Zastanawia mnie to ... dlatego też  może spróbujemy via TW  później i zerknę co się tam dzieje u ciebie<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 9 lip 2016, o 15:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StaryAnoda]]></name></author>
<updated>2016-07-09T12:45:41+01:00</updated>
<published>2016-07-09T12:45:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163724#p163724</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163724#p163724"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163724#p163724"><![CDATA[
Panowie czas na !!! BURZĘ MÓZGÓW !!!<br /><br />Na podstawie rozmowy z SunRiverem, wychodzi na to, że coś robię źle, mój projekt który kompiluję w mbed nie działa. Natomiast jeżeli uruchomię program skompilowany od Suna działa, Czyli w obecnej sytuacji wyświetlacz mam prawidłowo podłączony tyczy się to też czujnika temperatury. Jeżeli ktoś ma jakiekolwiek pomysły co może być jakieś uwagi przypuszczenia to proszę pisać.<br /><br />Dodaję kod który próbuję uruchomić:<br />Pochodzi ze strony sunduino.pl<br />[syntax=cpp]#include &quot;mbed.h&quot;<br />#include &quot;FT_Platform.h&quot;<br />#include &quot;FT_color.h&quot;<br />#include &quot;stdio.h&quot;<br />#include &quot;float.h&quot;<br />#include &quot;DS1820.h&quot;<br /><br /><br /><br /><br />#define SAMAPP_DELAY_BTW_APIS (1000)<br />#define SAMAPP_ENABLE_DELAY() Ft_Gpu_Hal_Sleep(SAMAPP_DELAY_BTW_APIS)<br />#define SAMAPP_ENABLE_DELAY_VALUE(x) Ft_Gpu_Hal_Sleep(x)<br />#define DATA_PIN A1<br /><br />FT800 TFT(D11,D12,D13,D9,D8,D14);<br /><br />unsigned int r,b,g;<br />char buffer&#91;50&#93;;<br />Ticker tick;<br /><br />Serial usart(D1, D0); <br />DS1820 probe(DATA_PIN);<br /><br /><br /><br /><br />ft_void_t Termometr(ft_char8_t *str, ft_float_t temp){<br />    //float temp;<br />    const char* str2 = &quot;SunRiver DS18B20 Demo&quot;;<br />    TFT.DLstart();                             // przygotowanie na nową listę nkomend <br />    TFT.DL(CLEAR_COLOR_RGB(255,255,255));      // kolor tła (biały)<br />    TFT.DL(CLEAR(1,1,1));                      // czyszczenie buforów --&gt; color, stencil, tag<br />    <br />    // wyswietlanie napisów <br />    TFT.DL(COLOR_RGB(0,0,255));                // kolor napisów <br />    TFT.Text((TFT.DispWidth/2), TFT.DispHeight/2, 31, OPT_CENTERX, str);  <br />    TFT.DL(COLOR_RGB(0,0,0)); <br />    TFT.Text((400), 360, 30, OPT_CENTERX, str2); <br />    TFT.DL(COLOR_RGB(255,0,0)); <br />    TFT.NumFloat((400), 280, 31, OPT_CENTERX, temp);<br />        <br />    <br />    TFT.DL(COLOR_RGB(0,255,0));                            // kolorek <br /><br />    TFT.Gauge(400,160, 100, OPT_NOBACK, 5, 4, temp, 100);<br /><br />    TFT.DL(DISPLAY());                         // Wyswietlamy przygotowany screen <br />    TFT.Swap();                                <br />    TFT.Flush_Co_Buffer();                     // pobieramy komendy z FiFo<br /><br />    TFT.WaitCmdfifo_empty();                   // czekanie na zakończenie operacji<br />    TFT.Sleep(1000);                          // koniec wyswietlania (15000 = 15sec)<br />}<br /><br /><br /><br /><br />int main()<br />{<br />    <br />    <br />    usart.baud(38400);  <br />    TFT.Flush_Co_Buffer();                         <br />    TFT.WaitCmdfifo_empty();                       <br />    //Demo_Screen2(&quot;TEST&quot;);                        <br />    <br />     <br />                            <br />    while(1) <br />    {<br />        probe.convertTemperature(true, DS1820::all_devices);         <br />        usart.printf(&quot;Temperatura to %3.3f Celsiusza\r\n&quot;, probe.temperature());<br />        <br />        Termometr(&quot;Temperatura&quot;, probe.temperature());<br />      //  wait(1);<br />    }<br /><br />    <br />}[/syntax]<br /><br />Jeszcze w załączniku cały projekt z mbed<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=12916">StaryAnoda</a> — 9 lip 2016, o 12:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2016-07-03T21:44:39+01:00</updated>
<published>2016-07-03T21:44:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163309#p163309</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163309#p163309"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163309#p163309"><![CDATA[
po paru modyfikacjach np tak działa:<br /><br /><div style="width: 583px; height: 471px; margin: 0 auto; padding-left: 26px; padding-top: 48px; background: url('https://www.atnel.pl/download/atnel_tv.png') no-repeat;"> <strong>iframe</strong> </div><br /><br />jak nie dasz rady to poczekaj opisze co i jak na stronie ....\<br /><!-- m --><a class="postlink" href="http://www.sunduino.pl/wordpress/ft81x-i-frdm-k64f-czesc-3/" >http://www.sunduino.pl/wordpress/ft81x- ... f-czesc-3/</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 3 lip 2016, o 21:44</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2016-07-03T09:45:55+01:00</updated>
<published>2016-07-03T09:45:55+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163265#p163265</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163265#p163265"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163265#p163265"><![CDATA[
Nie widzę problemu działa prawidłowo:<br /><br /><a href="https://obrazkiforum.atnel.pl/58/349048cc1dfc24ef4a8a5d66fc9cd52f.JPG"  class="postlink"><img src="https://obrazkiforum.atnel.pl/thumb/58/349048cc1dfc24ef4a8a5d66fc9cd52f.JPG" alt="Obrazek" /></a><br /><br />dodałem :<br />[syntax=cpp]#include &quot;DS1820.h&quot;<br /><br />#define DATA_PIN A1<br /><br />void DS18B20_read_temp() <br />{<br />   DS1820 probe(DATA_PIN);<br />   probe.convertTemperature(true, DS1820::all_devices);       <br />   wait(1);<br />   probe.temperature() == temp;<br />   TFT_Number(400,400,30,1, temp);<br />   wait(1);<br />   return;<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 3 lip 2016, o 09:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StaryAnoda]]></name></author>
<updated>2016-07-02T21:21:24+01:00</updated>
<published>2016-07-02T21:21:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163263#p163263</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163263#p163263"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163263#p163263"><![CDATA[
Całą funkcję void hsv2rgb(double H,double S, double V); usunąłem, ponieważ i tak z niej nie korzystam. Nie próbowałem, nawet wyświetlać tej temperatury na wyświetlaczu, ze względu na to, że na terminalu jej nie otrzymuję, więc wyświetlanie jej jest w tej chwili zbędne.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=12916">StaryAnoda</a> — 2 lip 2016, o 21:21</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[SunRiver]]></name></author>
<updated>2016-07-02T21:01:37+01:00</updated>
<published>2016-07-02T21:01:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163262#p163262</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163262#p163262"/>
<title type="html"><![CDATA[Re: [MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163262#p163262"><![CDATA[
Co to ma być w 34 lini ?<br />Funkcja main ma być pod wlasnymi funkcjami <br />Odczyt dsa przenies do funkcji np DS18B20-read()<br />Nie widzę byś gdziekolwiek wyswietlal tem na wyświetlaczu <br />Powinieneś przez TFT_Number(x, y, rf,opt, temp);<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=58">SunRiver</a> — 2 lip 2016, o 21:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StaryAnoda]]></name></author>
<updated>2016-07-02T18:45:49+01:00</updated>
<published>2016-07-02T18:45:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163261#p163261</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163261#p163261"/>
<title type="html"><![CDATA[[MBED] FT810 + DS18B20 nie działają razem]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15702&amp;p=163261#p163261"><![CDATA[
Witam!<br /><br />Panowie mam problem, uruchomiłem wyświetlacz na sterowniku FT810. Następnym krokiem było wyświetlenie temperatury na tym wyświetlaczu przy pomocy czujnika temperatury DS18B20. Niestety wspólnie pomiar temperatury nie działa, czy ktoś może rzucić okiem.<br /><br />Program Czujnik temperatury:<br />Biblioteka od Erik Olieman<br />[syntax=cpp]#include &quot;mbed.h&quot;<br />#include &quot;DS1820.h&quot;<br /><br />#define DATA_PIN D2<br />#define MAX_PROBES 16<br />  <br />DS1820* probe&#91;MAX_PROBES&#93;;<br /> <br />int main() {  <br />    // Initialize the probe array to DS1820 objects<br />    int num_devices = 0;<br />    while(DS1820::unassignedProbe(DATA_PIN)) {<br />        probe&#91;num_devices&#93; = new DS1820(DATA_PIN);<br />        num_devices++;<br />        if (num_devices == MAX_PROBES)<br />            break;<br />    }<br />    <br />    printf(&quot;Found %d device(s)\r\n\n&quot;, num_devices);<br />    while(1) {<br />        probe&#91;0&#93;-&gt;convertTemperature(true, DS1820::all_devices);         //Start temperature conversion, wait until ready<br />        for (int i = 0; i&lt;num_devices; i++)<br />            printf(&quot;Device %d returns %3.1foC\r\n&quot;, i, probe&#91;i&#93;-&gt;temperature());<br />        printf(&quot;\r\n&quot;);<br />        wait(1);<br />    }<br />    <br />}[/syntax]<br /><br />Program wyświetlacz FT810:<br />Biblioteka od: Team The Best<br />A kod main.cpp ze strony: sunduino.pl<br />[syntax=cpp]/*<br /> * FT81x DEMO <br /> * SunRiver<br /> */<br /> <br /> //------------------ Includy<br />#include &quot;mbed.h&quot;<br />#include &quot;FT_Platform.h&quot;<br />#include &quot;FT_color.h&quot;<br />#include &quot;stdio.h&quot;<br />#include &quot;float.h&quot;<br />#include &quot;SDFileSystem.h&quot;<br /><br />// ------------------ Definki<br />#define SAMAPP_DELAY_BTW_APIS (1000)<br />#define SAMAPP_ENABLE_DELAY() Ft_Gpu_Hal_Sleep(SAMAPP_DELAY_BTW_APIS)<br />#define SAMAPP_ENABLE_DELAY_VALUE(x) Ft_Gpu_Hal_Sleep(x)<br /><br />//ft81x (mosi,miso,sck,ss,int,pd)  ---&gt; połączenia pinów <br />FT800 TFT(D11,D12,D13,D9,D8,D14);<br /><br />//sd card (mosi,miso,sck,ss)  ---&gt; połączenia SD<br />SDFileSystem sd(D11, D12, D13, D10, &quot;sd&quot;);<br /><br />//zmienne globalne <br />unsigned int r, b, g;<br />char buffer&#91;50&#93;;<br /><br />void hsv2rgb(double H,double S, double V);<br /><br />int main(void)<br />{<br />    int err = 1995;<br />    <br />    TFT.MemWrite(REG_ROTATE, 1);<br />    TFT.Rotate(1);<br />    <br />    TFT.DLstart();                                         // startowanie <br />    TFT.DL(CLEAR_COLOR_RGB(255,255,255));                  // ustawiamy kolor na biały<br />    TFT.DL(CLEAR(1,1,1));                                  // kasowanie buforów -&gt; color buffer,stencil buffer, tag buffe<br /><br />    <br />    TFT.DL(COLOR_RGB(0,0,0));                          // aktualny kolor<br />    TFT.Text(TFT.DispWidth/2, TFT.DispHeight/2, 25, OPT_CENTERX, &quot;FT810CB&quot;); // text czcionka 31 <br />        <br />    TFT.DL(COLOR_RGB(221,0,0));<br />    TFT.Text(TFT.DispWidth/4, TFT.DispHeight/4, 25, OPT_CENTERX, &quot;www.sunduino.pl&quot;); <br />        <br />    TFT.DL(COLOR_RGB(0,0,0));   <br />    TFT.Number(50,50,25,OPT_SIGNED,err);<br />        <br />        <br />    TFT.DL(DISPLAY());     <br />    TFT.Swap();                                            <br />    TFT.Flush_Co_Buffer();                                 <br />    TFT.WaitCmdfifo_empty();                             <br />}<br /><br />void hsv2rgb(double H,double S, double V)<br />{<br />    double f,h,p,q,t;<br />    int i;<br />    if( S == 0.0) {<br />        r = V * 255;  <br />        g = V * 255;<br />        b = V * 255;<br />        return;<br />    }<br />    if(H &gt; 480.0) H = 0.0;   // check values<br />    if(S &gt; 1.0) S = 1.0; <br />    if(S &lt; 0.0) S = 0.0;<br />    if(V &gt; 1.0) V = 1.0;<br />    if(V &lt; 0.0) V = 0.0;<br />    <br />    h = H / 60.0;<br />    i = (int) h;<br />    f = h - i;<br />    p = V * (1.0 - S);<br />    q = V * (1.0 - (S * f));<br />    t = V * (1.0 - (S * (1.0 - f)));<br /> <br />    switch(i) {<br />        case 0:<br />            r = V * 255;  <br />            g = t * 255;<br />            b = p * 255;<br />            break;<br />        case 1:<br />            r = q * 255;<br />            g = V * 255;<br />            b = p * 255;<br />            break;<br />        case 2:<br />            r = p * 255;<br />            g = V * 255;<br />            b = t * 255;<br />            break;<br />        case 3:<br />            r = p * 255;<br />            g = q * 255;<br />            b = V * 255;<br />            break;<br />        case 4:<br />            r = t * 255;<br />            g = p * 255;<br />            b = V * 255;<br />            break;<br />        case 5:<br />        default:<br />            r = V * 255;<br />            g = p * 255;<br />            b = q * 255;<br />            break;<br />    }  <br />}[/syntax]<br /><br />Wspólny program:<br />[syntax=cpp]/*<br /> * FT81x DEMO <br /> * SunRiver<br /> */<br /> <br /> //------------------ Includy<br />#include &quot;mbed.h&quot;<br />#include &quot;FT_Platform.h&quot;<br />#include &quot;FT_color.h&quot;<br />#include &quot;stdio.h&quot;<br />#include &quot;float.h&quot;<br />#include &quot;SDFileSystem.h&quot;<br />#include &quot;DS1820.h&quot;<br /><br />// ------------------ Definki<br />#define DATA_PIN D2<br />#define MAX_PROBES 16<br />#define SAMAPP_DELAY_BTW_APIS (1000)<br />#define SAMAPP_ENABLE_DELAY() Ft_Gpu_Hal_Sleep(SAMAPP_DELAY_BTW_APIS)<br />#define SAMAPP_ENABLE_DELAY_VALUE(x) Ft_Gpu_Hal_Sleep(x)<br /><br />//ft81x (mosi,miso,sck,ss,int,pd)  ---&gt; połączenia pinów <br />FT800 TFT(D11,D12,D13,D9,D8,D14);<br /><br />//sd card (mosi,miso,sck,ss)  ---&gt; połączenia SD<br />SDFileSystem sd(D11, D12, D13, D10, &quot;sd&quot;);<br /><br />//zmienne globalne <br />unsigned int r, b, g;<br />char buffer&#91;50&#93;;<br /><br />DS1820* probe&#91;MAX_PROBES&#93;;<br /><br />void hsv2rgb(double H,double S, double V);<br /><br />int main(void)<br />{<br />    int err = 1995;<br />    <br />    int num_devices = 0;<br />    while(DS1820::unassignedProbe(DATA_PIN)) {<br />    probe&#91;num_devices&#93; = new DS1820(DATA_PIN);<br />    num_devices++;<br />    if (num_devices == MAX_PROBES)<br />    break;<br />    }<br />    <br />    <br />    printf(&quot;Found %d device(s)\r\n\n&quot;, num_devices);<br />    <br />    TFT.MemWrite(REG_ROTATE, 1);<br />    TFT.Rotate(1);<br />    <br />    TFT.DLstart();                                         // startowanie <br />    TFT.DL(CLEAR_COLOR_RGB(255,255,255));                  // ustawiamy kolor na biały<br />    TFT.DL(CLEAR(1,1,1));                                  // kasowanie buforów -&gt; color buffer,stencil buffer, tag buffe<br /><br />    <br />    TFT.DL(COLOR_RGB(0,0,0));                          // aktualny kolor<br />    TFT.Text(TFT.DispWidth/2, TFT.DispHeight/2, 25, OPT_CENTERX, &quot;FT810CB&quot;); // text czcionka 31 <br />        <br />    TFT.DL(COLOR_RGB(221,0,0));<br />    TFT.Text(TFT.DispWidth/4, TFT.DispHeight/4, 25, OPT_CENTERX, &quot;www.sunduino.pl&quot;); <br />        <br />    TFT.DL(COLOR_RGB(0,0,0));   <br />    TFT.Number(50,50,25,OPT_SIGNED,err);<br />        <br />        <br />    TFT.DL(DISPLAY());     <br />    TFT.Swap();                                            <br />    TFT.Flush_Co_Buffer();                                 <br />    TFT.WaitCmdfifo_empty();   <br />     <br />    while(1)<br />    {<br />        probe&#91;0&#93;-&gt;convertTemperature(true, DS1820::all_devices);         //Start temperature conversion, wait until ready<br />        for (int i = 0; i&lt;num_devices; i++)<br />        printf(&quot;Device %d returns %3.1foC\r\n&quot;, i, probe&#91;i&#93;-&gt;temperature());<br />        printf(&quot;\r\n&quot;);<br />        wait(1);<br />    }                          <br />}<br /><br />void hsv2rgb(double H,double S, double V)<br />{<br />    double f,h,p,q,t;<br />    int i;<br />    if( S == 0.0) {<br />        r = V * 255;  <br />        g = V * 255;<br />        b = V * 255;<br />        return;<br />    }<br />    if(H &gt; 480.0) H = 0.0;   // check values<br />    if(S &gt; 1.0) S = 1.0; <br />    if(S &lt; 0.0) S = 0.0;<br />    if(V &gt; 1.0) V = 1.0;<br />    if(V &lt; 0.0) V = 0.0;<br />    <br />    h = H / 60.0;<br />    i = (int) h;<br />    f = h - i;<br />    p = V * (1.0 - S);<br />    q = V * (1.0 - (S * f));<br />    t = V * (1.0 - (S * (1.0 - f)));<br /> <br />    switch(i) {<br />        case 0:<br />            r = V * 255;  <br />            g = t * 255;<br />            b = p * 255;<br />            break;<br />        case 1:<br />            r = q * 255;<br />            g = V * 255;<br />            b = p * 255;<br />            break;<br />        case 2:<br />            r = p * 255;<br />            g = V * 255;<br />            b = t * 255;<br />            break;<br />        case 3:<br />            r = p * 255;<br />            g = q * 255;<br />            b = V * 255;<br />            break;<br />        case 4:<br />            r = t * 255;<br />            g = p * 255;<br />            b = V * 255;<br />            break;<br />        case 5:<br />        default:<br />            r = V * 255;<br />            g = p * 255;<br />            b = q * 255;<br />            break;<br />    }  <br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=12916">StaryAnoda</a> — 2 lip 2016, o 18:45</p><hr />
]]></content>
</entry>
</feed>