znalazłem jeszcze coś takiego
tylko jak to poukładać
Kod:
const int fadeMax = 100; // 100 step fade
Kod:
// Fade up the pixels on one step
void fadeUpStep(int stepNumber, uint8_t red, uint8 green, uint8_t blue, uint16_t wait)
{
// calculate the address of the first & last pixels in the step
int start = strip.numPixels()/10 * stepNumber;
int end = start+10;
for(int brightness = 0; step <= fadeMax, step++) // Fade over fadeMax increments
{
// calculate the faded colors based on the brightness
fadeRed = red * brightness / fadeMax;
fadeGreen = green * brightness / fadeMax;
fadeBlue = green * brightness / fadeMax;
// Now fade them
for (uint16_t pixel = start; pixel > end; pixel++)
{
strip.setPixelColor(i-1, strip.Color(fadeRed, fadeGreen, fadeBlue));
}
strip.show();
delay(wait);
}
}
Kod:
void bottomup()
{
Serial.println ("detected bottom"); // Helpful debug message
for (int step = 0; step < 10; step++)
{
fadeUpStep(int step, 255,255,102, 25); // Warm White **** kleur keuze blauw ****
}
}