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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-10-13T14:22:32+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=47&amp;t=16277&amp;mode</id>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-13T14:22:32+01:00</updated>
<published>2016-10-13T14:22:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171421#p171421</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171421#p171421"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171421#p171421"><![CDATA[
Chodzi o ten kawałek kodu.<br />[syntax=cpp]// Generally, you should use &quot;unsigned long&quot; for variables that hold time<br />// The value will quickly become too large for an int to store<br />unsigned long previousMillis = 0;        // will store last time LED was updated<br /><br />// constants won't change :<br />const long interval = 1000;           // interval at which to blink (milliseconds)<br /><br />void setup() {<br /><br />}<br /><br />void loop() {<br />  <br />  unsigned long currentMillis = millis();<br /><br />  if (currentMillis - previousMillis &gt;= interval) {<br />    // save the last time you blinked the LED<br />    previousMillis = currentMillis;<br /><br /> <br /><br />   <br />  }<br />}[/syntax]<br />Tylko że nie wiem nawet gdzie to wcisnąć tu<br />[syntax=cpp]#include &lt;SoftwareSerial.h&gt;<br /><br />#include &lt;Adafruit_NeoPixel.h&gt;<br />SoftwareSerial BT(10, 11);<br /><br />#define PIXEL_PIN    6    <br /><br />#define PIXEL_COUNT 115<br />Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);<br />bool RotOld = LOW;<br />bool GreenOld = LOW;<br />bool BlueOld = LOW;<br />bool offOld = LOW;<br />bool rainOld = LOW;<br />bool rgbOld = LOW;<br />int showType = 0;<br /><br /><br /><br />void setup() {<br />   Serial.begin(9600);<br />   BT.begin(9600);<br />    BT.println(&quot;Hello from Arduino&quot;);<br />        Serial.println(&quot;Hello from Arduino&quot;);<br />  strip.begin();<br />  strip.show();<br />}<br />char a;<br />void loop() {<br />  bool off = LOW;<br />  bool Blue = LOW;<br />  bool Rot = LOW;<br />  bool Green = LOW;<br />    bool rain = LOW;<br />  bool rgb = LOW;<br />  bool ende;<br />   if (BT.available())<br />   {<br />    a= (char)BT.read();<br /><br />    if(a=='o')<br />    {<br />      off = HIGH;<br /><br />    }else{<br />          off = LOW;<br />  <br />    }<br />    if(a=='b')<br />    {<br />      Blue = HIGH;<br />       <br />    }else{<br />          Blue = LOW;<br />  <br />    }<br /><br />if(a=='r')<br />    {<br />      Rot = HIGH;<br />      <br />    }else{<br />          Rot = LOW;<br />  <br />    }<br /><br />if(a=='g')<br />    {<br />      Green = HIGH;<br />      <br />    }else{<br />          Green = LOW;<br />  <br />    }<br />    if(a=='a')<br />    {<br />      rain = HIGH;<br />      <br />    }else{<br />          rain = LOW;<br />  <br />    }<br />     if(a=='m')<br />    {<br />      rgb = HIGH;<br />      <br />    }else{<br />          rgb = LOW;<br />  <br />    }<br />}<br />  <br />  if (off == LOW &amp;&amp; offOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (off == LOW) {<br />       showType = 0  ;<br />     <br />      startShow(showType);<br />    }<br />  }<br />  if (Blue == LOW &amp;&amp; BlueOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (Blue == LOW) {<br />       showType = 3  ;<br />     <br />      startShow(showType);<br />    }<br />  }<br />  if (Rot == LOW &amp;&amp; RotOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (Rot == LOW) {<br />       showType = 1  ;<br />     <br />      startShow(showType);<br />    }<br />  }<br />  if (Green == LOW &amp;&amp; GreenOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (Green == LOW) {<br />       showType = 2  ;<br />     <br />      startShow(showType);<br />    }<br />  }<br />    if (rain == LOW &amp;&amp; rainOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (rain == LOW) {<br />showType = 8;<br />      startShow(showType);<br />    }<br />  }<br />      if (rgb == LOW &amp;&amp; rgbOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (rgb == LOW) {<br />   showType = 7;<br />     rgb = HIGH;<br /><br />      startShow(showType);<br />    }<br />  }<br /><br /><br />RotOld = Rot;<br />  BlueOld = Blue;<br />GreenOld = Green;<br />  offOld = off;<br />  rainOld = rain;<br />  rgbOld = rgb;<br />}<br /><br />void startShow(int i) {<br />  switch(i){<br />    case 0: colorWipe(strip.Color(0, 0, 0), 50);    // Black/off<br />            break;<br />    case 1: colorWipe(strip.Color(255, 0, 0), 50);  // Red<br />            break;<br />    case 2: colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            break;<br />    case 3: colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            break;<br />    case 7: colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            rainbowCycle(20);<br />            break;<br />    case 8: rainbowCycle(20);<br />            break;<br />  }<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 />// 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 />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 (int 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 (int 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]<br />Wiem że w tym miejscu jest czas jak długo działa.<br />[syntax=cpp]case 1: colorWipe(strip.Color(255, 0, 0), 50);  // Red 50 to czas. i on jest pobierany do <br />            break;<br /><br /><br />            void colorWipe(uint32_t c, uint8_t wait) do 'wait'  delay(wait);[/syntax]<br /><br />Na tak zaawansowanym poziomie nie jestem aby to zmienić  <img src="https://forum.atnel.pl/images/smilies/icon_redface.gif" alt=":oops:" title="Zawstydzony" /><br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 31 minutach ]</span></strong><br /><br />[syntax=cpp]#include &lt;SoftwareSerial.h&gt;<br /><br />#include &lt;Adafruit_NeoPixel.h&gt;<br />SoftwareSerial BT(10, 11);<br /><br />#define PIXEL_PIN    6    <br />unsigned long previousMillis=0; // millis() returns an unsigned long.<br />#define PIXEL_COUNT 115<br />Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ800);<br />bool RotOld = LOW;<br />bool GreenOld = LOW;<br />bool BlueOld = LOW;<br />bool offOld = LOW;<br />bool rainOld = LOW;<br />bool rgbOld = LOW;<br />int showType = 0;<br /><br /><br /><br />void setup() {<br />   Serial.begin(9600);<br />   BT.begin(9600);<br />    BT.println(&quot;Hello from Arduino&quot;);<br />        Serial.println(&quot;Hello from Arduino&quot;);<br />  strip.begin();<br />  strip.show();<br />}<br />char a;<br />void loop() {<br />  unsigned long currentMillis = millis();<br />  bool off = LOW;<br />  bool Blue = LOW;<br />  bool Rot = LOW;<br />  bool Green = LOW;<br />    bool rain = LOW;<br />  bool rgb = LOW;<br />  bool ende;<br />   if (BT.available())<br />   {<br />    a= (char)BT.read();<br /><br />    if(a=='o')<br />    {<br />      off = HIGH;<br /><br />    }else{<br />          off = LOW;<br />  <br />    }<br />    if(a=='b')<br />    {<br />      Blue = HIGH;<br />       <br />    }else{<br />          Blue = LOW;<br />  <br />    }<br /><br />if(a=='r')<br />    {<br />      Rot = HIGH;<br />      <br />    }else{<br />          Rot = LOW;<br />  <br />    }<br /><br />if(a=='g')<br />    {<br />      Green = HIGH;<br />      <br />    }else{<br />          Green = LOW;<br />  <br />    }<br />    if(a=='a')<br />    {<br />      rain = HIGH;<br />      <br />    }else{<br />          rain = LOW;<br />  <br />    }<br />     if(a=='m')<br />    {<br />      rgb = HIGH;<br />      <br />    }else{<br />          rgb = LOW;<br />  <br />    }<br />}<br />  <br />  if (off == LOW &amp;&amp; offOld == HIGH) {<br />   unsigned long currentMillis = millis(); // grab current time<br /> // check if &quot;interval&quot; time has passed (1000 milliseconds)<br /> if ((unsigned long)(currentMillis - previousMillis) &gt;= 20) {<br />   <br />    if (off == LOW) {<br />       showType = 0  ;<br />     <br />      startShow(showType);<br />      previousMillis = millis();<br />    }<br />  }}<br />  if (Blue == LOW &amp;&amp; BlueOld == HIGH) {<br />    unsigned long currentMillis = millis(); // grab current time<br /> // check if &quot;interval&quot; time has passed (1000 milliseconds)<br /> if ((unsigned long)(currentMillis - previousMillis) &gt;= 20) {<br />   <br />    <br />    if (Blue == LOW) {<br />       showType = 3  ;<br />     <br />       startShow(showType);<br />      previousMillis = millis();<br />    }<br />  }}<br />  if (Rot == LOW &amp;&amp; RotOld == HIGH) {<br />       unsigned long currentMillis = millis(); // grab current time<br /> // check if &quot;interval&quot; time has passed (1000 milliseconds)<br /> if ((unsigned long)(currentMillis - previousMillis) &gt;= 20) {<br />   <br />    <br />    if (Rot == LOW) {<br />       showType = 1  ;<br />     <br />      startShow(showType);<br />      previousMillis = millis();<br />    }<br />  }}<br />  if (Green == LOW &amp;&amp; GreenOld == HIGH) {<br />       unsigned long currentMillis = millis(); // grab current time<br /> // check if &quot;interval&quot; time has passed (1000 milliseconds)<br /> if ((unsigned long)(currentMillis - previousMillis) &gt;= 20) {<br />   <br />    <br />    if (Green == LOW) {<br />       showType = 2  ;<br />     <br />     startShow(showType);<br />      previousMillis = millis();<br />    }<br />  }}<br />    if (rain == LOW &amp;&amp; rainOld == HIGH) {<br />       unsigned long currentMillis = millis(); // grab current time<br /> // check if &quot;interval&quot; time has passed (1000 milliseconds)<br /> if ((unsigned long)(currentMillis - previousMillis) &gt;= 20) {<br />   <br />    <br />    if (rain == LOW) {<br />    showType = 8;<br />        startShow(showType);<br />      previousMillis = millis();<br />    }<br />  }}<br />      if (rgb == LOW &amp;&amp; rgbOld == HIGH) {<br />    delay(20);<br />   <br />    <br />    if (rgb == LOW) {<br />   showType = 7;<br />     rgb = HIGH;<br /><br />      startShow(showType);<br />    }<br />  }<br /><br /><br />RotOld = Rot;<br />  BlueOld = Blue;<br />GreenOld = Green;<br />  offOld = off;<br />  rainOld = rain;<br />  rgbOld = rgb;<br />}<br /><br />void startShow(int i) {<br />  switch(i){<br />    case 0: colorWipe(strip.Color(0, 0, 0), 100);    // Black/off<br />            break;<br />    case 1: colorWipe(strip.Color(255, 0, 0), 100);  // Red<br />            break;<br />    case 2: colorWipe(strip.Color(0, 255, 0), 100);  // Green<br />            break;<br />    case 3: colorWipe(strip.Color(0, 0, 255), 100);  // Blue<br />            break;<br />    case 7: colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 20);<br />            colorWipe(strip.Color(0, 255, 0), 20);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 20);  // Blue<br />            colorWipe(strip.Color(255, 0, 0), 50);<br />            colorWipe(strip.Color(0, 255, 0), 50);  // Green<br />            colorWipe(strip.Color(0, 0, 255), 50);  // Blue<br />            theaterChase(strip.Color(  0,   0, 127), 50); // Blue<br />            theaterChase(strip.Color(127,   0,   0), 50); // Red<br />            theaterChase(strip.Color(0,   127,   0), 50); // Red<br />            rainbowCycle(20);<br />            break;<br />    case 8: rainbowCycle(20);<br />            break;<br />  }<br />}<br /><br />// Fill the dots one after the other with a color<br />void colorWipe(uint32_t c, uint8_t wait) {<br />  unsigned long currentMillis = millis();<br />  if ((unsigned long)(currentMillis - previousMillis) &gt;= wait) {<br />  for(uint16_t i=0; i&lt;strip.numPixels(); i++) {<br />    strip.setPixelColor(i, c);<br />    strip.show();<br />     previousMillis = millis();<br />  }<br />  }<br />}<br /><br />// Slightly different, this makes the rainbow equally distributed throughout<br />void rainbowCycle(uint8_t wait) {<br />unsigned long currentMillis = millis();<br />  if ((unsigned long)(currentMillis - previousMillis) &gt;= 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 />    previousMillis = millis();<br />  }<br />}<br />}<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 (int i=0; i &lt; strip.numPixels(); i=i+3) {<br />        strip.setPixelColor(i+q, c);    //turn every third pixel on<br />      }<br />      unsigned long currentMillis = millis();<br />  if ((unsigned long)(currentMillis - previousMillis) &gt;= wait) {<br />      strip.show();<br /><br />        previousMillis = millis();<br />  }<br /><br />      for (int 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]<br /><br /><br />Zrobiłam tak ale teraz nie ma tego samego efektu czas jest bardzo szybki i nadal nie mogę przełączyć switch w czasie trwania<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 13 paź 2016, o 14:22</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-12T11:33:21+01:00</updated>
<published>2016-10-12T11:33:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171297#p171297</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171297#p171297"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171297#p171297"><![CDATA[
A coś więcej jakieś informacje jak szukać po jakich nazwach<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 12 paź 2016, o 11:33</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-11T19:55:39+01:00</updated>
<published>2016-10-11T19:55:39+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171236#p171236</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171236#p171236"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171236#p171236"><![CDATA[
Nie mam BB<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 11 paź 2016, o 19:55</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[michal1210]]></name></author>
<updated>2016-10-11T18:28:32+01:00</updated>
<published>2016-10-11T18:28:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171229#p171229</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171229#p171229"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171229#p171229"><![CDATA[
Z Arduino się nie bawiłem ale musisz uruchomić timera, szukaj w ten sposób.<br />A nie masz książki BB?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=998">michal1210</a> — 11 paź 2016, o 18:28</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-10-11T15:29:52+01:00</updated>
<published>2016-10-11T15:29:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171221#p171221</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171221#p171221"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=171221#p171221"><![CDATA[
Hm szukam i nie mogę znaleźć jakiś poradnik byś miał lub jakiś kod<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 11 paź 2016, o 15:29</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Harry]]></name></author>
<updated>2016-09-23T12:40:38+01:00</updated>
<published>2016-09-23T12:40:38+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169416#p169416</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169416#p169416"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169416#p169416"><![CDATA[
<div class="quotetitle">aska12 napisał(a):</div><div class="quotecontent"><br />No tak, Mam tak zrobione ale jeżeli funkcja nie doleci do końca to nie zmienię na kolejną.<br /></div><br />Bo blokujesz procka na czas wykonywania funkcji, poszukaj na forum jak zrobić funkcję nieblokującą, nawet kilka dni temu był podobny temat.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=14685">Harry</a> — 23 wrz 2016, o 12:40</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-09-23T08:51:56+01:00</updated>
<published>2016-09-23T08:51:56+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169400#p169400</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169400#p169400"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169400#p169400"><![CDATA[
<div class="quotetitle">michal1210 napisał(a):</div><div class="quotecontent"><br />Można np.: <br />Każdy efekt to osobna funkcja,<br />Wciśnięcie klawisza zwiększa jakąś zmienną o jeden,<br />W pętli głównej za pomocą instrukcji &quot;switch case&quot; wywołujesz dany efekt(funkcje) na podstawie tej zmiennej (zależnej od klawisza)<br /></div><br /><br /><br />No tak, Mam tak zrobione ale jeżeli funkcja nie doleci do końca to nie zmienię na kolejną.<br /><br />[syntax=cpp]#include &lt;Adafruit_NeoPixel.h&gt;<br /><br />#define PIN 6<br />#define LICZBADIOD 30<br />Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LICZBADIOD, PIN, NEO_GRB + NEO_KHZ800);<br /><br />const int modePin = 8; <br /><br />int mode = 0; <br />int val = 0; <br />int butState = 0;<br />int modeState = 0; <br />boolean debug = 1; <br /><br /><br />void setup () {<br />  pinMode(modePin, INPUT);<br />  if (debug) {<br />    Serial.begin(9600);<br />    Serial.print(&quot;Initial Mode: &quot;);<br />    Serial.println(mode);<br />    Serial.print(&quot;Setup Complete\n&quot;);<br />  }<br />}<br /><br /><br />void loop() {<br /><br />  val = digitalRead(modePin);<br /><br /><br />  if (val != butState &amp;&amp; val == HIGH) {<br />    mode++;<br />  }<br /><br />  butState = val; <br /><br /> <br />  if (modeState != mode) {<br /><br />  <br /><br />    switch ( mode ) {<br />      <br /><br />      case 2:<br />        // kod pentli<br />        showState();<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 />        break;<br />      case 3:<br />        // kod pentli<br />        showState();<br />         for (int i = 0; i &lt; LICZBADIOD; i++)<br />        {<br />          pixels.setPixelColor(i, 0, 0, 255); // 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 />        break;<br />      case 4:<br />         for (int i = 0; i &lt; LICZBADIOD; i++)<br />        {<br />          pixels.setPixelColor(i, 0, 255, 0); // Dioda &quot;i&quot; oraz skladowe R=255 G=0 B=0<br />          pixels.setBrightness(255);<br />          pixels.show(); // Wysylamy dane do lancucha<br />          delay(500); // Opoznienie 500ms przed zaswieceniem kolejnej diody<br />        }<br />        showState();<br />        break;<br />      default:<br />        mode = 1;<br /><br />        showState();<br />        break;<br />    } <br />   } <br />  } <br />  modeState = mode;<br />  delay(10);<br />}<br /><br /><br />void showState() {<br />  if (debug) {<br />    Serial.print(&quot;Mode: &quot;);<br />    Serial.println(mode);<br />  }<br />}[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 23 wrz 2016, o 08:51</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[michal1210]]></name></author>
<updated>2016-09-21T23:12:08+01:00</updated>
<published>2016-09-21T23:12:08+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169310#p169310</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169310#p169310"/>
<title type="html"><![CDATA[Re: Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169310#p169310"><![CDATA[
Można np.: <br />Każdy efekt to osobna funkcja,<br />Wciśnięcie klawisza zwiększa jakąś zmienną o jeden,<br />W pętli głównej za pomocą instrukcji &quot;switch case&quot; wywołujesz dany efekt(funkcje) na podstawie tej zmiennej (zależnej od klawisza)<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=998">michal1210</a> — 21 wrz 2016, o 23:12</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[aska12]]></name></author>
<updated>2016-09-21T20:00:28+01:00</updated>
<published>2016-09-21T20:00:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169294#p169294</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169294#p169294"/>
<title type="html"><![CDATA[Pomoc w zrobieniu pierwszej dużej funkcji i zrozumienie]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=16277&amp;p=169294#p169294"><![CDATA[
Witam od kilku dni chcę zrobić funkcję pętlę która pozwoli mi wybrać efekt z jaką ma palić się pasek Led WS2812B np mają przechodzić piksele co trzy Ledy w danym kolorze a następnie po przygnieceniu klawisza swatcha zmienia się na inny np kolor chcę zrobić kilkanaście takich efektów co kuknięcie inny efekt aby się uruchamiał jakiś pomysł jak wkładać Funkcję z efektem do głównego programu.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3612">aska12</a> — 21 wrz 2016, o 20:00</p><hr />
]]></content>
</entry>
</feed>