If you are running out of digital pins (2 through 13) in a bigger project or circuit you can use analogRead(pin#) to read from a digital input. The theoretical analogRead values for this example are 1023 (not pressed) and 0 (pressed).
Hello thank you for an insightful video. One question standard value is 1023, and then goes to 0 when button pressed. What will happen if the button have internal resistance which is about 500 ohms, when short curcuited?