const int sensor = A3;
int sensVal;
void setup() {
pinMode(sensor, INPUT);
for(int x = 4; x <= 9; x++){pinMode(x, OUTPUT);}
Serial.begin(9600);
}
void loop() {
sensVal = analogRead(sensor);
Serial.println(sensVal); delay(50);
int ON = map(sensVal, 73, 130, 9, 4);
for(int x = 9; x >= ON; x--){digitalWrite(x, HIGH);}
for(int x = 4; x < ON; x++) {digitalWrite(x, LOW);}
}