- Get rid of the cap.
- Put a 0.1uF cap from each device's Vcc pin to Gnd.
- Fix your code to output 2 bytes every time you want the output updated.
void updateShiftRegister()
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, LSBFIRST, leds1);
shiftOut(dataPin, clockPin, LSBFIRST, leds2);
digitalWrite(latchPin, HIGH);
}
and keep the data you are sending out in leds1 and leds2