<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[forum.rcl-radio.ru &mdash; w2812]]></title>
		<link>http://forum.rcl-radio.ru/viewtopic.php?id=287</link>
		<atom:link href="http://forum.rcl-radio.ru/extern.php?action=feed&amp;tid=287&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «w2812».]]></description>
		<lastBuildDate>Wed, 17 Mar 2021 16:39:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: w2812]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=3297#p3297</link>
			<description><![CDATA[<p>#define L_BIT&nbsp; &nbsp; PORTB &amp;= ~(1&lt;&lt;0)<br />#define H_BIT&nbsp; &nbsp; PORTB |=&nbsp; (1&lt;&lt;0)&nbsp; &nbsp; <br />#define LED_MAX&nbsp; 4</p><p>unsigned long data, dat[LED_MAX];</p><p>void setup(){<br />&nbsp; &nbsp;DDRB |= (1&lt;&lt;0);<br />}</p><p>void loop(){<br />&nbsp; &nbsp;for(int i1=0;i1&lt;LED_MAX;i1++){<br />&nbsp; for(int i=0;i&lt;50;i++){<br />&nbsp; &nbsp;<br />&nbsp; data_led(i1,&nbsp; 50,50-i1*3,50-i);<br />&nbsp; led_rgb();res();<br />&nbsp; delay(10);<br />&nbsp; }}</p><p>&nbsp; for(int i1=0;i1&lt;LED_MAX;i1++){<br />&nbsp; data_led(i1,0,0,0);<br />&nbsp; led_rgb();res();<br />&nbsp; delay(500);<br />&nbsp; }<br />}</p><p>void bit_0(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);&nbsp; &nbsp;L_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);&nbsp; &nbsp;asm(&quot;nop&quot;);}<br />void bit_1(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);&nbsp; &nbsp;L_BIT;}<br />void bit_w(bool x){if(x) bit_1(); else bit_0();}<br />void res(){delayMicroseconds(100);}</p><p>void data_led(int num, long rrr, int ggg, byte bbb){<br />&nbsp; data = ((rrr &lt;&lt; 16) &amp; 0xFF0000) + ((ggg &lt;&lt; 8) &amp; 0xFF00) + bbb;<br />&nbsp; dat[num] = data;<br />&nbsp; }</p><p>void led_rgb(){<br />&nbsp; for(int num_i=0;num_i&lt;LED_MAX;num_i++){data=dat[num_i];<br />&nbsp; cli();<br />bit_w(data &amp; 0x80);<br />bit_w(data &amp; 0x40);<br />bit_w(data &amp; 0x20);<br />bit_w(data &amp; 0x10);<br />bit_w(data &amp; 0x08);<br />bit_w(data &amp; 0x04);<br />bit_w(data &amp; 0x02);<br />bit_w(data &amp; 0x01);<br />bit_w(data &amp; 0x800000);<br />bit_w(data &amp; 0x400000);<br />bit_w(data &amp; 0x200000);<br />bit_w(data &amp; 0x100000);<br />bit_w(data &amp; 0x080000);<br />bit_w(data &amp; 0x040000);<br />bit_w(data &amp; 0x020000);<br />bit_w(data &amp; 0x010000);&nbsp; <br />bit_w(data &amp; 0x8000);&nbsp; &nbsp; <br />bit_w(data &amp; 0x4000);&nbsp; &nbsp; <br />bit_w(data &amp; 0x2000);&nbsp; &nbsp; <br />bit_w(data &amp; 0x1000);&nbsp; &nbsp; <br />bit_w(data &amp; 0x0800);&nbsp; &nbsp; <br />bit_w(data &amp; 0x0400);&nbsp; &nbsp; <br />bit_w(data &amp; 0x0200);&nbsp; &nbsp; <br />bit_w(data &amp; 0x0100); <br />&nbsp; &nbsp;sei(); <br />delayMicroseconds(10);<br />}}</p>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 17 Mar 2021 16:39:53 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=3297#p3297</guid>
		</item>
		<item>
			<title><![CDATA[Re: w2812]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=3296#p3296</link>
			<description><![CDATA[<div class="codebox"><pre><code>#define L_BIT    PORTB &amp;= ~(1&lt;&lt;0)
#define H_BIT    PORTB |=  (1&lt;&lt;0)    
#define LED_MAX  4

byte times;
int i=0;
unsigned long data;
unsigned long dat[LED_MAX];

void setup(){
   DDRB |= (1&lt;&lt;0);
}

void loop(){
   
res();
  for(int i1=0; i&lt;LED_MAX; i++)
  for(int i=0; i&lt;LED_MAX; i++) {
  
  if(i%2==1)data_led(i,50,0,0);
  else data_led(i,0,0,50);
  led();
  delay(500);
  }
  }

void bit_0(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   asm(&quot;nop&quot;);}
void bit_1(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;}
void bit_w(bool x){if(x) bit_1(); else bit_0();}
void res(){delayMicroseconds(100);}

void data_led(int num, long rrr, int ggg, byte bbb){
  data = ((rrr &lt;&lt; 16) &amp; 0xFF0000) + ((ggg &lt;&lt; 8) &amp; 0xFF00) + bbb;
  dat[num] = data;
  return dat[num];
  }

void led(){
  for(i=0;i&lt;LED_MAX;i++){data=dat[i];
  cli();
bit_w(data  &amp; 0b100000000000000000000000);
bit_w(data  &amp; 0b010000000000000000000000);
bit_w(data  &amp; 0b001000000000000000000000);
bit_w(data  &amp; 0b000100000000000000000000);
bit_w(data  &amp; 0b000010000000000000000000);
bit_w(data  &amp; 0b000001000000000000000000);
bit_w(data  &amp; 0b000000100000000000000000);
bit_w(data  &amp; 0b000000010000000000000000);

bit_w(data  &amp; 0b000000000000000010000000);
bit_w(data  &amp; 0b000000000000000001000000);
bit_w(data  &amp; 0b000000000000000000100000);
bit_w(data  &amp; 0b000000000000000000010000);
bit_w(data  &amp; 0b000000000000000000001000);
bit_w(data  &amp; 0b000000000000000000000100);
bit_w(data  &amp; 0b000000000000000000000010);
bit_w(data  &amp; 0b000000000000000000000001);  
    
bit_w(data  &amp; 0b000000001000000000000000);    
bit_w(data  &amp; 0b000000000100000000000000);    
bit_w(data  &amp; 0b000000000010000000000000);    
bit_w(data  &amp; 0b000000000001000000000000);    
bit_w(data  &amp; 0b000000000000100000000000);    
bit_w(data  &amp; 0b000000000000010000000000);    
bit_w(data  &amp; 0b000000000000001000000000);    
bit_w(data  &amp; 0b000000000000000100000000);    
   sei(); 
delayMicroseconds(10);
  }
  }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 17 Mar 2021 14:37:23 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=3296#p3296</guid>
		</item>
		<item>
			<title><![CDATA[Re: w2812]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=3295#p3295</link>
			<description><![CDATA[<div class="codebox"><pre><code>#define L_BIT    PORTB &amp;= ~(1&lt;&lt;0)
#define H_BIT    PORTB |=  (1&lt;&lt;0)    

byte times;
int i=0;

void setup(){
   DDRB |= (1&lt;&lt;0);
}

void loop(){ 
  

    led(10, 0, 0);
     led(0, 10, 0);
      led(0, 0, 10);
       led(10, 0, 0);
    res();
  delay(500);

  }

void bit_0(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   asm(&quot;nop&quot;);}
void bit_1(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;}
void bit_w(bool x){if(x) bit_1(); else bit_0();}
void res(){delayMicroseconds(100);}

void led(long rrr, int ggg, byte bbb){
  unsigned long data = ((rrr &lt;&lt; 16) &amp; 0xFF0000) + ((ggg &lt;&lt; 8) &amp; 0xFF00) + bbb;
  cli();
bit_w(data  &amp; 0b100000000000000000000000);
bit_w(data  &amp; 0b010000000000000000000000);
bit_w(data  &amp; 0b001000000000000000000000);
bit_w(data  &amp; 0b000100000000000000000000);
bit_w(data  &amp; 0b000010000000000000000000);
bit_w(data  &amp; 0b000001000000000000000000);
bit_w(data  &amp; 0b000000100000000000000000);
bit_w(data  &amp; 0b000000010000000000000000);

bit_w(data  &amp; 0b000000000000000010000000);
bit_w(data  &amp; 0b000000000000000001000000);
bit_w(data  &amp; 0b000000000000000000100000);
bit_w(data  &amp; 0b000000000000000000010000);
bit_w(data  &amp; 0b000000000000000000001000);
bit_w(data  &amp; 0b000000000000000000000100);
bit_w(data  &amp; 0b000000000000000000000010);
bit_w(data  &amp; 0b000000000000000000000001);  
    
bit_w(data  &amp; 0b000000001000000000000000);    
bit_w(data  &amp; 0b000000000100000000000000);    
bit_w(data  &amp; 0b000000000010000000000000);    
bit_w(data  &amp; 0b000000000001000000000000);    
bit_w(data  &amp; 0b000000000000100000000000);    
bit_w(data  &amp; 0b000000000000010000000000);    
bit_w(data  &amp; 0b000000000000001000000000);    
bit_w(data  &amp; 0b000000000000000100000000);    
   sei(); 
delayMicroseconds(10);
  
  }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 17 Mar 2021 13:34:27 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=3295#p3295</guid>
		</item>
		<item>
			<title><![CDATA[Re: w2812]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=3294#p3294</link>
			<description><![CDATA[<div class="codebox"><pre><code>#define L_BIT    PORTB &amp;= ~(1&lt;&lt;0)
#define H_BIT    PORTB |=  (1&lt;&lt;0)    

byte times;


void setup(){
   DDRB |= (1&lt;&lt;0);
   delayMicroseconds(1000); 

}

void loop(){ 
   if(times&gt;254){times=0;}
   led(255,0,0);
   led(0,255,0);
   led(0,0,255);
   led(255-times,255-times,50);
   delayMicroseconds(100);
   times++;
   delay(10);
  }

void bit_0(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   asm(&quot;nop&quot;);}
void bit_1(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;}
void bit_w(bool x){if(x) bit_1(); else bit_0();}

void led(byte rrr, byte ggg, byte bbb){
  unsigned long data = ((rrr &lt;&lt; 8) &amp; 0xFF0000) | ((ggg &lt;&lt; 8) &amp; 0xFF00) | bbb;
  cli();
bit_w(data  &amp; 0b100000000000000000000000);
bit_w(data  &amp; 0b010000000000000000000000);
bit_w(data  &amp; 0b001000000000000000000000);
bit_w(data  &amp; 0b000100000000000000000000);
bit_w(data  &amp; 0b000010000000000000000000);
bit_w(data  &amp; 0b000001000000000000000000);
bit_w(data  &amp; 0b000000100000000000000000);
bit_w(data  &amp; 0b000000010000000000000000);

bit_w(data  &amp; 0b000000000000000010000000);
bit_w(data  &amp; 0b000000000000000001000000);
bit_w(data  &amp; 0b000000000000000000100000);
bit_w(data  &amp; 0b000000000000000000010000);
bit_w(data  &amp; 0b000000000000000000001000);
bit_w(data  &amp; 0b000000000000000000000100);
bit_w(data  &amp; 0b000000000000000000000010);
bit_w(data  &amp; 0b000000000000000000000001);  
    
bit_w(data  &amp; 0b000000001000000000000000);    
bit_w(data  &amp; 0b000000000100000000000000);    
bit_w(data  &amp; 0b000000000010000000000000);    
bit_w(data  &amp; 0b000000000001000000000000);    
bit_w(data  &amp; 0b000000000000100000000000);    
bit_w(data  &amp; 0b000000000000010000000000);    
bit_w(data  &amp; 0b000000000000001000000000);    
bit_w(data  &amp; 0b000000000000000100000000);    
   sei(); 
delayMicroseconds(10);
  }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Wed, 17 Mar 2021 09:28:11 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=3294#p3294</guid>
		</item>
		<item>
			<title><![CDATA[w2812]]></title>
			<link>http://forum.rcl-radio.ru/viewtopic.php?pid=3289#p3289</link>
			<description><![CDATA[<div class="codebox"><pre><code>#define L_BIT    PORTB &amp;= ~(1&lt;&lt;0)
#define H_BIT    PORTB |=  (1&lt;&lt;0)    

byte times;


void setup(){
   DDRB |= (1&lt;&lt;0);

   delayMicroseconds(1000); 

}

void loop(){ 
   if(times&gt;254){times=0;}
   led(0x000000+times);
   led(0x000000);
   led(0x010000);
   led(0x000100);
   delayMicroseconds(100);
   times++;
   delay(10);
  }

void bit_0(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   asm(&quot;nop&quot;);}
void bit_1(){H_BIT;asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);asm(&quot;nop&quot;);   L_BIT;}
void bit_w(bool x){if(x) bit_1(); else bit_0();}

void led(unsigned long data){
  cli();
bit_w(data  &amp; 0b100000000000000000000000);
bit_w(data  &amp; 0b010000000000000000000000);
bit_w(data  &amp; 0b001000000000000000000000);
bit_w(data  &amp; 0b000100000000000000000000);
bit_w(data  &amp; 0b000010000000000000000000);
bit_w(data  &amp; 0b000001000000000000000000);
bit_w(data  &amp; 0b000000100000000000000000);
bit_w(data  &amp; 0b000000010000000000000000);

bit_w(data  &amp; 0b000000000000000010000000);
bit_w(data  &amp; 0b000000000000000001000000);
bit_w(data  &amp; 0b000000000000000000100000);
bit_w(data  &amp; 0b000000000000000000010000);
bit_w(data  &amp; 0b000000000000000000001000);
bit_w(data  &amp; 0b000000000000000000000100);
bit_w(data  &amp; 0b000000000000000000000010);
bit_w(data  &amp; 0b000000000000000000000001);  
    
bit_w(data  &amp; 0b000000001000000000000000);    
bit_w(data  &amp; 0b000000000100000000000000);    
bit_w(data  &amp; 0b000000000010000000000000);    
bit_w(data  &amp; 0b000000000001000000000000);    
bit_w(data  &amp; 0b000000000000100000000000);    
bit_w(data  &amp; 0b000000000000010000000000);    
bit_w(data  &amp; 0b000000000000001000000000);    
bit_w(data  &amp; 0b000000000000000100000000);    
   sei(); 
delayMicroseconds(20);
  }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (liman324)]]></author>
			<pubDate>Mon, 15 Mar 2021 18:07:24 +0000</pubDate>
			<guid>http://forum.rcl-radio.ru/viewtopic.php?pid=3289#p3289</guid>
		</item>
	</channel>
</rss>
