This repeats the bit value five times, instead of four zeroes and the bit value once through the loop. Try
shiftOut(dataPin, clockPin, MSBFIRST, f.chip == c ? bit : 0);
This repeats the bit value five times, instead of four zeroes and the bit value once through the loop. Try
shiftOut(dataPin, clockPin, MSBFIRST, f.chip == c ? bit : 0);