Push Button LED Control experiment questions?

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?

int led_out = 11 ;
int keypad_pin = 7;
int value;
void setup()
{
pinMode(led_out,OUTPUT);
pinMode(keypad_pin,INPUT);
digitalWrite(led_out,LOW);
}
void loop()
{
value = digitalRead(keypad_pin);
if( value == LOW )
{
digitalWrite(led_out,HIGH);
}
else
{
digitalWrite(led_out,LOW);
}
}

Can be either, but HIGH is more common. Try and you figure out.
You have VCC and OUT swapped, VCC should go to 5V pin and OUT to 7.

Which text book are you referring to here? Or do you mean that is your expectation?

LED on when a button is pressed, is a function that depends on both your wiring and code.

Likewise LED off when a button is pressed, is a function that depends on both your wiring and code.

Welcome

In future please use code tags when posting code (or error messages) as described in https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code.

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

My replay was about these kind of buttons on image, they have usually pulldown onboard.

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.

Just swap the rolls of Vcc and GND.

a7