Maximum number of SN74HC165N

Herodes:
Both with LED and with relays, both work correctly.

Then what is your issue at the moment?

If you are using the latest code you posted in reply #20, then you will always set all out outputs LOW. You never set anything to HIGH.

Jobi-Wan:
When you change your clearRegisters() function to set everything to HIGH instead of LOW, do all your outputs go high?

Jobi-Wan:
How did you test and confirm that your outputs are working?
Can you explain in detail how your program works? Especially writeRegisters() and setRegisterPin()