I am making a keypad that prints to an LCD screen. I do not have a reason to keep the buttons in rows so I am only using 1 row. Whenever I press a button, the output is always '1'. Changing the first keymap value to anything else makes the output that, meaning that whatever input I give, it thinks it is the first button. I have checked my wiring and even disconnected the first button entirely but it still reads all input as the first button. The majority of the code is copied from the library's example. Here it is
You do not say which Arduino board you are using but if it is an AVR based board such as a Uno or Nano then it is unwise to use pin 1 because it is used by the Serial interface. I know that you are not using the Serial interface to print anything but you do have Serial.begin() in the sketch.
I am using an Arduino Uno R3.
I was testing the output in serial first and forgot to delete that. Using serial as an output poses the same problem. Only '1' is shown.
I am working on a keypad using the keypad library. Whenever I push on a button, the serial monitor reads '1'. Changing the corresponding value on the keymap also changes the output, this value being the first column and the first row. Changing the dimensions of the keypad shows similar results. The library requires multiple push buttons to be connected through a single wire and also for them to be connected individually. Simulating this using a wire that can connect the buttons in series shows that the code works fine so it is not the problem. However, I only have breadboard jumper cables with me so I can not do such a thing. I have tried imitating it but for some reason, it is not working. This is my circuitry
Simulating my code using this circuitry in TinkerCad also shows the exact same problem.