====== Arduino-WS (7) ====== #include const int LEDPin = 4; const int NPixels = 18; // LED Streifen Länge CRGB leds[NPixels]; typedef struct { uint8_t ex; // existiert uint8_t r,g,b; float pos, tempo; } Lichtpunkt; int Lichtpunkte = 0; const int MaxLichtpunkte = 6; Lichtpunkt lichter[MaxLichtpunkte]; void setup() { for (int i=0; i(leds, NPixels); } void loop() { if (random(30)==1) { for (int i=0; i=NPixels) continue; // ausserhalb => nix tun leds[ pos ].setRGB ( lichter[i].r, lichter[i].g, lichter[i].b ); lichter[i].pos += lichter[i].tempo; // lichter[i].pos = lichter[i].pos + lichter[i].tempo; if (lichter[i].pos >= NPixels) { lichter[i].ex = 0; } lichter[i].tempo += 0.01; } } FastLED.show(); delay(10); }