|data||String or blob||
The data to write to the bus
This method writes the specified data to the target SPI bus and returns the number of bytes written.
Any data arriving on MISO while writing is taking place is ignored.
After writing, MOSI is held at the level of the last transmitted bit.
The following code shows you how to write to an 8-bit shift register — a 74HC595 — via SPI. Note that this implementation also uses two GPIO pins: the first, pin 8, is used for Slave Select and the second, pin 1, to reset the SPI device.