int slide = A14;
void setup() {
// put your setup code here, to run once:
for (int count = 2; count <= 11; count = count + 1) {
pinMode(count, OUTPUT);
}
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int slideA = analogRead(slide);
// 0 - 1023
// 2 - 11
int convert = (slideA / 102) + 2; // 2-11
Serial.print(" slideA: ");
Serial.print(slideA);
Serial.print(" convert: ");
Serial.println(convert);
for (int count = 2; count < convert; count = count + 1) {
digitalWrite(count, HIGH);
}
delay(10);
for (int count = 2; count <= convert; count = count + 1) {
digitalWrite(count, LOW);
}
}