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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2018-03-07T07:30:41+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=20336&amp;mode</id>
<entry>
<author><name><![CDATA[mczarny]]></name></author>
<updated>2018-03-07T07:30:41+01:00</updated>
<published>2018-03-07T07:30:41+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205076#p205076</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205076#p205076"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205076#p205076"><![CDATA[
W jednym z poradników o magic ledach masz to omówione szczegółowo. Omawiana jest przestrzeń HSV i wszystko co potrzebne do prawidłowego działania funkcji. Strzelam - część dziewiąta<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=4651">mczarny</a> — 7 mar 2018, o 07:30</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kuba]]></name></author>
<updated>2018-03-06T22:28:24+01:00</updated>
<published>2018-03-06T22:28:24+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205070#p205070</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205070#p205070"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205070#p205070"><![CDATA[
Coś z tymi strukturami i typdefem robie nie tak <br />[syntax=c]// -----------------------    definicje typów<br />typedef struct {<br />    uint8_t g;<br />    uint8_t r;<br />    uint8_t b;<br />} TWSRGB;<br /> <br />typedef union {<br />    uint8_t b&#91;3&#93;;<br />    TWSRGB px;<br />} TRGB;<br /> <br /> <br />// -----------------------    zmienne globalne<br />TRGB led&#91;1&#93;;<br /><br /> hsv_to_rgb1( tutaj nie wiem w jaki sposób to zapisać , 80, 100, 255);[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1439">kuba</a> — 6 mar 2018, o 22:28</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2018-03-06T14:24:53+01:00</updated>
<published>2018-03-06T14:24:53+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205043#p205043</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205043#p205043"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205043#p205043"><![CDATA[
<div class="quotetitle">kuba napisał(a):</div><div class="quotecontent"><br />Mam dalszy problem niwiem w jaki sposób zapisć argument do tej funkcji<br /></div><br />polecam zacząć od książki:<br /><br /><!-- m --><a class="postlink" href="http://atnel.pl/mikrokontrolery-avr-jezyk-c.html" >http://atnel.pl/mikrokontrolery-avr-jezyk-c.html</a><!-- m --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 6 mar 2018, o 14:24</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kuba]]></name></author>
<updated>2018-03-06T13:22:37+01:00</updated>
<published>2018-03-06T13:22:37+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205036#p205036</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205036#p205036"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=205036#p205036"><![CDATA[
Mam dalszy problem niwiem w jaki sposób zapisć argument do tej funkcji <br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;avr/interrupt.h&gt;<br />#include &lt;avr/pgmspace.h&gt;<br />#include &lt;util/delay.h&gt;<br /><br />#define LED_CNT     12<br /><br />#define JASNOSC    120<br /><br />#define MAGIC_PIN    (1&lt;&lt;PC2)<br /><br />//#define STRINGIFY(x) #x<br />//#define TOSTRING(x) STRINGIFY(x)<br />#define WS_PORT PORTC<br />#define WS_PIN  MAGIC_PIN<br />//#define DELAY   2<br /><br />// -----------------------    definicje typów<br />typedef struct {<br />    uint8_t g;<br />    uint8_t r;<br />    uint8_t b;<br />} TWSRGB;<br /><br />typedef union {<br />    uint8_t b&#91;3&#93;;<br />    TWSRGB px;<br />} TRGB;<br /><br />const uint8_t rt&#91;&#93; PROGMEM = {0, 16, 10, 6, 4, 2, 1};<br /><br />// -----------------------    zmienne globalne<br />TRGB led&#91;1&#93;;<br /><br /><br />// -----------------------    funkcje typu inline<br />inline void set_color( uint8_t r, uint8_t g, uint8_t b ) {<br />    led&#91;0&#93;.px.r = r;<br />    led&#91;0&#93;.px.g = g;<br />    led&#91;0&#93;.px.b = b;<br />}<br /><br />// -----------------------    nagłówki funkcji<br />void ws281x_asm_send( void );<br />void led_color( uint8_t cnt, uint8_t r, uint8_t g, uint8_t b );<br />void hsv_to_rgb1( TWSRGB * myrgb, uint8_t h, uint8_t s, uint8_t v);             <br /><br /><br />int main( void ) {<br /><br />    DDRC |= MAGIC_PIN;<br /><br />    // Set clock to 8 MHz<br /> //   CCP = 0xD8; // Unprotect CLKPSR reg<br /> //   CLKPSR = 0x00; // Divide by 1<br /><br />    _delay_ms( 10 );<br /><br />    led_color( 12, 0, 1, 0 );<br /><br />    hsv_to_rgb1( tutaj nie wiem w jaki sposób to zapisać , 80, 100, 255);<br /><br />     ws281x_asm_send();<br /><br />    while ( 1 ) {<br /><br />    }<br /><br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1439">kuba</a> — 6 mar 2018, o 13:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JarekB]]></name></author>
<updated>2018-03-01T07:59:12+01:00</updated>
<published>2018-03-01T07:59:12+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204754#p204754</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204754#p204754"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204754#p204754"><![CDATA[
Skopiowałem Twój kod do MkClipsa wybrałem Twój procek<br />Podczas kompilacji dostałem słuszny komunikat że kompilator nie wie co to za stwór &quot;TWSRGB&quot;<br />No to pogooglałem i dołożyłem definicję struktury<br />[syntax=c]typedef struct {<br />        uint8_t g;<br />        uint8_t r;<br />        uint8_t b;<br />}TWSRGB;[/syntax]<br /><br />Kompilator przestał się pyszczyć.<br />Cały kod zajmuje około 7% pamięci flash.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=18188">JarekB</a> — 1 mar 2018, o 07:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mczarny]]></name></author>
<updated>2018-03-01T07:14:46+01:00</updated>
<published>2018-03-01T07:14:46+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204753#p204753</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204753#p204753"/>
<title type="html"><![CDATA[Re: attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204753#p204753"><![CDATA[
cześć<br />co prawda nie bawiłem się attiny10 ale w tej funkcji nie ma rejestrów charakterystycznych do danego procesora więc nic nie trzeba przerabiać.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=4651">mczarny</a> — 1 mar 2018, o 07:14</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[kuba]]></name></author>
<updated>2018-02-28T22:58:17+01:00</updated>
<published>2018-02-28T22:58:17+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204743#p204743</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204743#p204743"/>
<title type="html"><![CDATA[attiny 10 i HSV]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=20336&amp;p=204743#p204743"><![CDATA[
Witam jak przerobić pod attiny 10 funkcje hsv <br />[syntax=c]void hsv_to_rgb1( TWSRGB * myrgb, uint8_t h, uint8_t s, uint8_t v) {<br /> <br />     uint16_t region, remainder, p, q, t;<br /> <br />  if (s == 0) myrgb-&gt;r = myrgb-&gt;g = myrgb-&gt;b = v;<br />  else {<br />      region = h*6 / 256;<br />      remainder = (h*6)%256;<br /> <br />      p = (v * (255 - s)) / 256;<br />      q = (v * (255 - (s * remainder)/256)) / 256;<br />      t = (v * (255 - (s * (255 - remainder))/256)) / 256;<br /> <br />      switch (region) {<br />             case 0:<br />                myrgb-&gt;r = v; myrgb-&gt;g = t; myrgb-&gt;b = p;<br />                 break;<br />             case 1:<br />                myrgb-&gt;r = q; myrgb-&gt;g = v; myrgb-&gt;b = p;<br />                 break;<br />             case 2:<br />                myrgb-&gt;r = p; myrgb-&gt;g = v; myrgb-&gt;b = t;<br />                 break;<br />             case 3:<br />                myrgb-&gt;r = p; myrgb-&gt;g = q; myrgb-&gt;b = v;<br />                 break;<br />             case 4:<br />                myrgb-&gt;r = t; myrgb-&gt;g = p; myrgb-&gt;b = v;<br />                 break;<br />             case 5:<br />                myrgb-&gt;r = v; myrgb-&gt;g = p; myrgb-&gt;b = q;<br />                 break;<br />         }<br />    }<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=1439">kuba</a> — 28 lut 2018, o 22:58</p><hr />
]]></content>
</entry>
</feed>