I need a little help with my coding. But before I start, i should mention that i have no prior knowledge of coding. But I did found this code that I like, it similiar to the audi style sequential lights. So one turns on stay lit and follow by the other 7 on the shift register. Now what I like to do is add a second shift register to it to have a total of 16 LEDs. I've tweak the code around alot but like mention with no knowledge of it I was just wasting time. So would anyone know what else to add to it so the the other 8 led on the second shift reg. Will light up right after the first one than cut out all at once?
int latchPin = 5;
int clockPin = 6;
int dataPin = 4;
byte leds = 0;
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop()
{
leds = 0;
updateShiftRegister();
delay(500);
for (int i = 0; i < 8; i++)
{
bitSet(leds, i);
updateShiftRegister();
delay(500);
}
}
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, leds);
digitalWrite(latchPin, HIGH);
}
