Maximum number of SN74HC165N

Jobi-Wan:
..which will never happen, because estado000 can be HIGH or LOW but never 9.

True. I already have a crazy head ...

Jobi-Wan:
When you say "corresponding relay", do you mean input #1 corresponds to relay #1, and #2 to #2, etc..?

Not necessarily. Now, to try, but later I want to have the freedom to change that.

Jobi-Wan:
In the for-loop, where you print a 1 or a 0, that is where you know the status of one input and you know the number of that input. So instead of just printing a 1 or a 0, you can set the corresponding register pin to HIGH or LOW. (To the same value that the input pin has.)

Even if this is not what you ultimately want, I would still do this first, because it is a good test.

That is exactly where I am now working. Do you think the problem is to use "1" and "0" instead of "HIGH" and "LOW"?