const int analogPin = A0;
const int ledCount = 9;
int ledPins[] = {2,3,4,5,6,7,8,9,10};



void setup() {
  for (int thisLed = 0; thisLed < ledCount; thisLed++) {
    pinMode(ledPins[thisLed], OUTPUT);
  }
  // put your setup code here, to run once:

}

void loop() {
  int sensorReading = analogRead(analogPin);
  int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);
  Serial.println(ledLevel);
  for (int thisLed = 0; thisLed < ledCount; thisLed++) {
    if (thisLed < ledLevel) {
      digitalWrite(ledPins[thisLed], HIGH);
    }
    else {
      digitalWrite(ledPins[thisLed], LOW);
    }
  }
  // put your main code here, to run repeatedly:

}
$abcdeabcde151015202530fghijfghij