How toggle the output of shift register individually with buttons?

What you're not getting is you're using eight calls and eight print statements to print things that vary only by the call number. There are ways to use the call number as a variable which would allow you to reduce this to one, or a few print statements, by refactoring. This can save considerable memory.

For example, you could pass the call number as an argument to a single function which prints any call number given to it.

dougp:
What you're not getting is you're using eight calls and eight print statements to print things that vary only by the call number. There are ways to use the call number as a variable which would allow you to reduce this to one, or a few print statements, by refactoring. This can save considerable memory.

For example, you could pass the call number as an argument to a single function which prints any call number given to it.

print statements is just for example to understand the problem inside the function.

Actually I want to communicate over RS485 for long distance. My protocol is half duplex like

Drive pin change to transmitter mode
Send data
Drive pin change to receiver mode
Receive data
Act based on received data
Some serial print.

So Simplest thing which I want to call the function in array of button sketch which is attached in #11. And button response time will be short.