User manual

Copyright © JOY-IT®
Code 2: Teil 2 der LED-Matrix
void loop() {
// Beispielhafte Farbabläufe:
farbDurchlauf(strip.Color(255, 0, 0), 50); // Rot
farbDurchlauf(strip.Color(0, 255, 0), 50); // Grün
farbDurchlauf(strip.Color(0, 0, 255), 50); // Blau
// Theater-Beleuchtung:
theaterBeleuchtung(strip.Color(127, 127, 127), 50); // Weiß
theaterBeleuchtung(strip.Color(127, 0, 0), 50); // Rot
theaterBeleuchtung(strip.Color(0, 0, 127), 50); // Blau
regenbogen(20);
regenbogenVerlauf(20);
theaterRegenbogen(50);
}
// LEDs nacheinander mit angegebener Farbe auffüllen
void farbDurchlauf(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
// Regenbogen
void regenbogen(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) {
for(i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel((i+j) & 255));
}
strip.show();
delay(wait);
}
}
// Leicht veränderter Regenbogen
void regenbogenVerlauf(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) {
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}