I am wondering if shiftOut method (defined in wiring_shift.c) could add a delay parameter since not all devices can handle the default tight timing.
In a project I did recently, the shifted output was sometimes garbled. And I had to modify the code to add a slight delay between the writes to get it working.
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, byte val)
{
int i;
for (i = 0; i < 8; i++) {
if (bitOrder == LSBFIRST)
digitalWrite(dataPin, !!(val & (1 << i)));
delay(5);
else
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
delay(5);
digitalWrite(clockPin, HIGH);
delay(5);
digitalWrite(clockPin, LOW);
delay(5);
}
}
If the next version of the library could take a delay parameter, it would definitely be more useful.