Storing a value

jucasan:
How can I replace this part of code just to read the button once?

In the IDE look under file/examples/digital/state change detection. What has to happen is to detect when the switch *becomes * pressed/unpressed. You use the resulting indirect flag value, which is true for only one scan through loop(), to increment, switch, or any number of other one-shot programming tasks.