#include <Adafruit_NeoPixel.h>
#define PIN 18
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 12
const byte interruptPin = 2;
#define BRIGHTNESS 255
#define DELAY_ON 50 // Zeitverzögerung zum Einschalten jeder LED
#define DELAY_OFF 50 // Zeitverzögerung zum Ausschalten der ersten LEDs
#define NUM_TO_LIGHT 5
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 250;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
strip.begin();
strip.show(); // Turn OFF all pixels ASAP
strip.setBrightness(BRIGHTNESS);
}
long random(int pixelNum, int numberOfLights) {
return random(pixelnum - numberOfLights - 10,pixelnum - numberOfLights);
}
void loop() {
for (int i = 0; i < NUMPIXELS; i++) {
for (int j = 0; j < NUM_TO_LIGHT; j++) {
int pixel = i + j;
if (pixel < NUMPIXELS) {
strip.setPixelColor(pixel, strip.Color(255, 0, 0)); // Rote LED einschalten
strip.setPixelColor(random(pixel,NUM_TO_LIGHT),strip.Color(255, 0, 0));
}
}
strip.show();
delay(DELAY_ON);
for (int j = 0; j < NUM_TO_LIGHT; j++) {
int pixel = i + j;
if (pixel < NUMPIXELS) {
strip.setPixelColor(pixel, strip.Color(0, 0, 0)); // LED wieder ausschalten
}
}
strip.show();
delay(DELAY_OFF);
}
delay(10);
}
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM)
strip.show(); // Update strip to match
delay(wait); // Pause for a moment
}
}
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
rgb1:VDD
rgb1:DOUT
rgb1:VSS
rgb1:DIN
rgb2:VDD
rgb2:DOUT
rgb2:VSS
rgb2:DIN
rgb3:VDD
rgb3:DOUT
rgb3:VSS
rgb3:DIN
rgb4:VDD
rgb4:DOUT
rgb4:VSS
rgb4:DIN
rgb5:VDD
rgb5:DOUT
rgb5:VSS
rgb5:DIN
rgb6:VDD
rgb6:DOUT
rgb6:VSS
rgb6:DIN
rgb7:VDD
rgb7:DOUT
rgb7:VSS
rgb7:DIN
rgb8:VDD
rgb8:DOUT
rgb8:VSS
rgb8:DIN
rgb9:VDD
rgb9:DOUT
rgb9:VSS
rgb9:DIN
rgb10:VDD
rgb10:DOUT
rgb10:VSS
rgb10:DIN
rgb11:VDD
rgb11:DOUT
rgb11:VSS
rgb11:DIN
rgb12:VDD
rgb12:DOUT
rgb12:VSS
rgb12:DIN