int potmeter1 = A0;
int potmeter2 = A1;
int ledCounter[] = {1, 3, 7, 15, 31, 63,127, 255};
const int latchPin1 = 10;
const int clockPin1 = 11;
const int dataPin1 = 12;
int numberToDisplay1 = 400;
void setup ()
{
Serial.begin(9600);
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);
}
void loop() {
// Serial.println(analogRead(potmeter1));
numberToDisplay1 = int(ledCounter[map(analogRead(potmeter1),0,1023,0,7)]);
// ST_CP LOW to keep LEDs from changing while reading serial data
digitalWrite(latchPin1, LOW);
// Shift out the bits
shiftOut_16(dataPin1, clockPin1, MSBFIRST, 7);
// ST_CP HIGH change LEDs
digitalWrite(latchPin1, HIGH);
delay(100);
//millis(500);
}