Jobi-Wan:
Congratulations!
Thanks!
Jobi-Wan:
You should change your writeRegisters() function so that that 595 are also numbered from zero.
How?
Jobi-Wan:
You are now using 1 byte (8 bits) to store the value of each output. You could store 8 outputs in 1 byte: 1 per bit.
How?
Jobi-Wan:
This entire block can be simplified into one single line. Basically: you set each register pin to the value you read from the input pin ... but it's not important as this is just a test.
How?