int AnzahlLED = 10;
int LEDPin[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int PotPin = A0;
int PotWert;
int helligkeit;
void setup() {
pinMode(PotPin, INPUT);
for (int i = 0; i <= AnzahlLED; i++) {
pinMode(LEDPin[i], OUTPUT);
}
}
void loop() {
PotWert = analogRead(PotPin);
helligkeit = map(PotWert, 0, 1023, 0, 255);
for (int i = 0; i <= AnzahlLED; i++) {
digitalWrite(LEDPin[i], helligkeit);
delay(100);
}
}