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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-10-17T09:54:08+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=47&amp;t=16513&amp;mode</id>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-17T09:54:08+01:00</updated>
<published>2016-10-17T09:54:08+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171841#p171841</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171841#p171841"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171841#p171841"><![CDATA[
<div class="quotetitle">Harry napisał(a):</div><div class="quotecontent"><br />sprawdź teraz, zapomniałem o else.<br />żeby zmienić na następną zmieniasz po prostu numerek diody, czyli twoje &quot;i&quot;, w tej chwili leci po kolei.<br /></div><br /><br /><br />O działa na jednym pasku a wiesz morze czy da się to tu wcisnąć <br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br />#ifdef __AVR__<br />  #include &lt;avr/power.h&gt;<br />#endif<br /><br />#define PIN 6<br /><br />// Parameter 1 = number of pixels in strip<br />// Parameter 2 = Arduino pin number (most are valid)<br />// Parameter 3 = pixel type flags, add together as needed:<br />//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)<br />//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)<br />//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)<br />//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)<br />//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)<br />Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);<br /><br />// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across<br />// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input<br />// and minimize distance between Arduino and first pixel.  Avoid connecting<br />// on a live circuit...if you must, connect GND first.<br /><br />void setup() {<br />  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket<br />  #if defined (__AVR_ATtiny85__)<br />    if (F_CPU == 16000000) clock_prescale_set(clock_div_1);<br />  #endif<br />  // End of trinket special code<br /><br /><br />  strip.begin();<br />  strip.show(); // Initialize all pixels to 'off'<br />}<br /><br />void loop() {<br />  // Some example procedures showing how to display to the pixels:<br />  colorWipe(strip.Color(255, 0, 0), 50); // Red<br />  colorWipe(strip.Color(0, 255, 0), 50); // Green<br />  colorWipe(strip.Color(0, 0, 255), 50); // Blue<br />//colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW<br />  // Send a theater pixel chase in...<br />  theaterChase(strip.Color(127, 127, 127), 50); // White<br />  theaterChase(strip.Color(127, 0, 0), 50); // Red<br />  theaterChase(strip.Color(0, 0, 127), 50); // Blue<br /><br />  rainbow(20);<br />  rainbowCycle(20);<br />  theaterChaseRainbow(50);<br />}<br /><br />// Fill the dots one after the other with a color<br />void colorWipe(uint32_t c, uint8_t wait) {<br />  for(uint16_t i=0; i&lt;strip.numPixels(); i++) {<br />    strip.setPixelColor(i, c);<br />    strip.show();<br />    delay(wait);<br />  }<br />}<br /><br />void rainbow(uint8_t wait) {<br />  uint16_t i, j;<br /><br />  for(j=0; j&lt;256; j++) {<br />    for(i=0; i&lt;strip.numPixels(); i++) {<br />      strip.setPixelColor(i, Wheel((i+j) &amp; 255));<br />    }<br />    strip.show();<br />    delay(wait);<br />  }<br />}<br /><br />// Slightly different, this makes the rainbow equally distributed throughout<br />void rainbowCycle(uint8_t wait) {<br />  uint16_t i, j;<br /><br />  for(j=0; j&lt;256*5; j++) { // 5 cycles of all colors on wheel<br />    for(i=0; i&lt; strip.numPixels(); i++) {<br />      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) &amp; 255));<br />    }<br />    strip.show();<br />    delay(wait);<br />  }<br />}<br /><br />//Theatre-style crawling lights.<br />void theaterChase(uint32_t c, uint8_t wait) {<br />  for (int j=0; j&lt;10; j++) {  //do 10 cycles of chasing<br />    for (int q=0; q &lt; 3; q++) {<br />      for (uint16_t i=0; i &lt; strip.numPixels(); i=i+3) {<br />        strip.setPixelColor(i+q, c);    //turn every third pixel on<br />      }<br />      strip.show();<br /><br />      delay(wait);<br /><br />      for (uint16_t i=0; i &lt; strip.numPixels(); i=i+3) {<br />        strip.setPixelColor(i+q, 0);        //turn every third pixel off<br />      }<br />    }<br />  }<br />}<br /><br />//Theatre-style crawling lights with rainbow effect<br />void theaterChaseRainbow(uint8_t wait) {<br />  for (int j=0; j &lt; 256; j++) {     // cycle all 256 colors in the wheel<br />    for (int q=0; q &lt; 3; q++) {<br />      for (uint16_t i=0; i &lt; strip.numPixels(); i=i+3) {<br />        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on<br />      }<br />      strip.show();<br /><br />      delay(wait);<br /><br />      for (uint16_t i=0; i &lt; strip.numPixels(); i=i+3) {<br />        strip.setPixelColor(i+q, 0);        //turn every third pixel off<br />      }<br />    }<br />  }<br />}<br /><br />// Input a value 0 to 255 to get a color value.<br />// The colours are a transition r - g - b - back to r.<br />uint32_t Wheel(byte WheelPos) {<br />  WheelPos = 255 - WheelPos;<br />  if(WheelPos &lt; 85) {<br />    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);<br />  }<br />  if(WheelPos &lt; 170) {<br />    WheelPos -= 85;<br />    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);<br />  }<br />  WheelPos -= 170;<br />  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 17 paź 2016, o 09:54</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Harry]]></name></author>
<updated>2016-10-16T23:23:00+01:00</updated>
<published>2016-10-16T23:23:00+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171823#p171823</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171823#p171823"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171823#p171823"><![CDATA[
sprawdź teraz, zapomniałem o else.<br />żeby zmienić na następną zmieniasz po prostu numerek diody, czyli twoje &quot;i&quot;, w tej chwili leci po kolei.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14685">Harry</a> — 16 paź 2016, o 23:23</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-16T22:55:07+01:00</updated>
<published>2016-10-16T22:55:07+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171822#p171822</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171822#p171822"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171822#p171822"><![CDATA[
Nada ledy zapalają się bez odstępu czasowego a to link do poprzedniego tematu <br /><br /><!-- l --><a class="postlink-local" href="http://forum.atnel.pl/topic16277.html" >topic16277.html</a><!-- l --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 16 paź 2016, o 22:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Harry]]></name></author>
<updated>2016-10-16T23:42:01+01:00</updated>
<published>2016-10-16T21:27:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171811#p171811</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171811#p171811"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171811#p171811"><![CDATA[
[syntax=cpp]i=0;<br /><br />void loop()<br />{<br />  unsigned long currentMillis = millis();<br /><br /> if (currentMillis - previousMillis &lt;= interval) {<br /><br />        pixels.setPixelColor(i, 102,  0, 102); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />        pixels.show(); // Wysylamy dane do lancucha        <br />} else { //tego zapomniałem ;)<br />        previousMillis = currentMillis;<br />        i++;<br />        if(i&gt;=LICZBADIOD){<br />           i=0;<br />        }<br />}[/syntax]<br /><br />Zrób mniej więcej tak, powinno działać, chociaż pisane na kolanie <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14685">Harry</a> — 16 paź 2016, o 21:27</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-16T21:02:45+01:00</updated>
<published>2016-10-16T21:02:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171800#p171800</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171800#p171800"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171800#p171800"><![CDATA[
Tak pętla się wykona ale jak ją spowolnić bo chcę dodać switch aby bluetooth sterować i wtedy nie mogę przed upływem delay przerwać<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 16 paź 2016, o 21:02</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Harry]]></name></author>
<updated>2016-10-16T19:20:45+01:00</updated>
<published>2016-10-16T19:20:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171785#p171785</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171785#p171785"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171785#p171785"><![CDATA[
<div class="quotetitle">aska12 napisał(a):</div><div class="quotecontent"><br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br />void loop()<br />{<br />  unsigned long currentMillis = millis();<br /> <br />  // save the last time you blinked the LED<br />  if (currentMillis - previousMillis &lt;= interval) {<br />    for (int i = 0; i &lt; LICZBADIOD; i++) {<br />        pixels.setPixelColor(i, 102,  0, 102); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />        pixels.show(); // Wysylamy dane do lancucha<br />      }<br />    }else{<br />      previousMillis = currentMillis;<br />    }<br />  }[/syntax]<br />Zmieniłam tak ale nadal się nie zapalają z odstępie czasu<br /></div><br /><br />Ciekawe czemu <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><br />A gdzie wstawiłaś if i for?<br />Przecież jeśli if się zgadza to wykonuje całą pętle for jednym ciurkiem, która zresztą nie jest tu do niczego potrzebna.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14685">Harry</a> — 16 paź 2016, o 19:20</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-16T18:01:14+01:00</updated>
<published>2016-10-16T18:01:14+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171767#p171767</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171767#p171767"/>
<title type="html"><![CDATA[Re: Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171767#p171767"><![CDATA[
[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br /> <br />#define PIN 6<br />#define LICZBADIOD 115<br />unsigned long previousMillis = 0;        // will store last time LED was updated<br /> <br />// constants won't change :<br />const long interval = 500;           // interval at which to blink (milliseconds)<br />Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LICZBADIOD, PIN, NEO_GRB + NEO_KHZ800);<br /> <br />void setup()<br />{<br />  pixels.begin(); // Inicjalizacja biblioteki<br />  pixels.clear();<br />}<br /> <br />void loop()<br />{<br />  unsigned long currentMillis = millis();<br /> <br />  // save the last time you blinked the LED<br />  if (currentMillis - previousMillis &lt;= interval) {<br />    for (int i = 0; i &lt; LICZBADIOD; i++) {<br />        pixels.setPixelColor(i, 102,  0, 102); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />        pixels.show(); // Wysylamy dane do lancucha<br />      }<br />    }else{<br />      previousMillis = currentMillis;<br />    }<br />  }[/syntax]<br />Zmieniłam tak ale nadal się nie zapalają z odstępie czasu<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 16 paź 2016, o 18:01</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-16T16:53:40+01:00</updated>
<published>2016-10-16T16:53:40+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171761#p171761</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171761#p171761"/>
<title type="html"><![CDATA[Pomoc w zmianie dlay na millis]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16513&amp;p=171761#p171761"><![CDATA[
Witam od kilku dni próbuję zmienić delay na millis<br /><br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br /><br />#define PIN 6<br />#define LICZBADIOD 115<br />unsigned long previousMillis = 0;        // will store last time LED was updated<br /><br />// constants won't change :<br />const long interval = 500;           // interval at which to blink (milliseconds)<br />Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LICZBADIOD, PIN, NEO_GRB + NEO_KHZ800);<br /><br />void setup()<br />{<br />  pixels.begin(); // Inicjalizacja biblioteki<br />  pixels.clear();<br />}<br /><br />void loop()<br />{<br />  unsigned long currentMillis = millis();<br /><br />  // save the last time you blinked the LED<br />  if (currentMillis - previousMillis &gt;= interval) {<br />    for (int i = 0; i &lt; LICZBADIOD; i++) {<br />        pixels.setPixelColor(i, 102,  0, 102); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />        pixels.show(); // Wysylamy dane do lancucha<br />      }<br />    }else{<br />      previousMillis = currentMillis;<br />    }<br />  }[/syntax]<br />robiłam tak jak wyżej ale nie działa sznur się nie włącza.<br />próbowałam również tak <br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br /><br />#define PIN 6<br />#define LICZBADIOD 115<br />unsigned long previousMillis = 0;        // will store last time LED was updated<br /><br />// constants won't change :<br />const long interval = 500;           // interval at which to blink (milliseconds)<br />Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LICZBADIOD, PIN, NEO_GRB + NEO_KHZ800);<br /><br />void setup()<br />{<br />  pixels.begin(); // Inicjalizacja biblioteki<br /> <br />}<br /><br />void loop()<br />{<br />  unsigned long currentMillis = millis();<br />  previousMillis = currentMillis;<br />  // save the last time you blinked the LED<br />if (currentMillis - previousMillis &gt;= interval) {<br />  for (int i = 0; i &lt; LICZBADIOD; i++) {<br />    <br />      pixels.setPixelColor(i, 102,  0, 102); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />      pixels.show(); // Wysylamy dane do lancucha<br />    <br />    }<br />  }<br />}[/syntax]<br />Tu nie ma przerwy a powinno być około 500ms<br />i czysty kod z delay<br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br /> <br />#define PIN 6<br />#define LICZBADIOD 115<br /> <br />Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LICZBADIOD, PIN, NEO_GRB + NEO_KHZ800);<br /> <br />void setup()<br />{<br />  pixels.begin(); // Inicjalizacja biblioteki<br />   <br />}<br /> <br />void loop()<br />{<br />  for(int i=0; i&lt;LICZBADIOD; i++)<br />  {<br />    pixels.setPixelColor(i, 255, 0, 0); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />    pixels.show(); // Wysylamy dane do lancucha<br />    delay(500); // Opoznienie 500ms przed zaswieceniem kolejnej diody<br />  }<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 16 paź 2016, o 16:53</p><hr />
]]></content>
</entry>
</feed>