Hello,
Im totally new at Arduino and WS2812b. I have found basic coding on link that is good for me.
There are 3 push buttons. When buttons are toggled i want them to change effects (i have it now on link). Now there is just color effect change on press of buttons. When you power Arduino in "standby" i would like "cylon" effect. After one of push buttons is pressed i would like fade in and fade out effect. Like one button, one color with fade in and fade out. I tried to add it but i always get errors. Please if somebody can help with a code. Thanks
Here is Cylon effect for standby when everthing is powered up
void loop() {
CylonBounce(0xff, 0, 0, 4, 10, 50);
}
void CylonBounce(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay){
for(int i = 0; i < NUM_LEDS-EyeSize-2; i++) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
for(int i = NUM_LEDS-EyeSize-2; i > 0; i--) {
setAll(0,0,0);
setPixel(i, red/10, green/10, blue/10);
for(int j = 1; j <= EyeSize; j++) {
setPixel(i+j, red, green, blue);
}
setPixel(i+EyeSize+1, red/10, green/10, blue/10);
showStrip();
delay(SpeedDelay);
}
delay(ReturnDelay);
}
And here is fade in and out effect that i would like to have on these three push buttons.
void loop() {
FadeInOut(0xff, 0x00, 0x00); // red
FadeInOut(0xff, 0xff, 0xff); // white
FadeInOut(0x00, 0x00, 0xff); // blue
}