Hello, Im new to arduino and I have a question.
I have this code and this is what the picture looks like.
When I tried the experiment the LED Light would start light on and when I clicked the button, the light would go off. Is this the opposite of what the textbook says? Where can I find more informaiton about the button
When I click the button is it considered "LOW" or "HIGH"?
Any other specifications about the button?
Looking at your breadboard layout it appears you have the button wired incorrectly.
As best I can tell from the image you have Vcc on the button connected to digital input 7, it should be connected to 5V, and OUT connected to 5V, it should be connected to digital input 7. Whether you have actually wired it that way I cannot tell from your photo, but I suggest you check.
As others have commented the behaviour depends on the wiring and the code. Not just your wiring but the way the button PCB has been made with the button attached, which we cannot tell from the information you have provided.
The pin going HIGH when a button is pressed is a common expectation because it seems to make more sense that something should turn on as a result, It is, after all, the normal way to wire a switch to turn on a light.
However, in the case of a microcontroller the pin changing from LOW to HIGH only serves to give an indication to the microcontroller that something has changed. That change might just as well be from HIGH to LOW.
That brings us to the subject of the normal state of the pin when the button is not pressed. It is good practice to use a resistor from the pin to either 5V or GND so that it is in a known state, HIGH or LOW. Doing this requires an extra resistor for each button but this requirement can be met by using a resistor within the microcontroller that pulls the pin HIGH when a pinMode() of INPUT_PULLUP is used.
To detect a button press when using INPUT_PULLUP the button is wired to take the pin LOW when pressed which, as notes above can seem counterintuitive
Doing this is so common that I suggest that LOW indicating that the switch is closed is more common
You'd be swimming upstream a bit, but those KY-004 modules can be wired so as to make the resistor pull the logic line up, and the switch short the input to ground.