Keep getting an input with push buttons without pressing

Heya! I keep getting inputs from my 4 push buttons,


while i haven’t even pressed them. This started happening after I soldered the buttons with jumper cables, but before everything worked just fine.
![image|666x500](upload://h6

M8N7D5ZClFQe1pGBmcc4dSdSs.jpeg)


#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
int buttonPinUp = 11;
int buttonPinLeft = 10;
int buttonPinDown = 9;
int buttonPinRight = 6;

void setup()
{
   pinMode(buttonPinUp, INPUT_PULLUP);
   pinMode(buttonPinLeft, INPUT_PULLUP);
   pinMode(buttonPinDown, INPUT_PULLUP);
   pinMode(buttonPinRight, INPUT_PULLUP);
   lcd.init();
   lcd.init();
   // Print a message to the LCD.
   lcd.backlight();
   lcd.setCursor(0, 0);
   lcd.print("oh no its not doing it");
}

void loop()
{
   int buttonValue = digitalRead(buttonPinUp);
   int buttonValue2 = digitalRead(buttonPinLeft);
   int buttonValue3 = digitalRead(buttonPinDown);
   int buttonValue4 = digitalRead(buttonPinRight);
   if (buttonValue == LOW)
   {
      // If button pushed, turn LED on
      lcd.backlight();
      lcd.setCursor(0, 0);
      lcd.print("Up");
      delay(500);
      lcd.clear();
   }
   else
   {
      Serial.print(":(");
   }
   if (buttonValue2 == LOW)
   {
      // If button pushed, turn LED on
      lcd.backlight();
      lcd.setCursor(0, 0);
      lcd.print("Left ");
      delay(500);
      lcd.clear();
   }
   else
   {
      Serial.print(":(");
   }
   if (buttonValue3 == LOW)
   {
      // If button pushed, turn LED on
      lcd.backlight();
      lcd.setCursor(0, 0);
      lcd.print("Down");
      delay(500);
      lcd.clear();
   }
   else
   {
      Serial.print(":(");
   }
   if (buttonValue4 == LOW)
   {
      // If button pushed, turn LED on
      lcd.backlight();
      lcd.setCursor(0, 0);
      lcd.print("Right");
      delay(500);
      lcd.clear();
   }
   else
   {
      Serial.print(":(");
   }
}

Are you setting the pinMode for those inputs to INPUT_PULLUP?

Post your code. Read the forum guidelines to see how to properly post code and some hints on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Yes, I am. Sorry completely forgot about the code.

Just a stupid question.. Did you connect the buttons right? most of thes buttons have 4 pins but are two by two interconnected..
If you disconnect ALL pushbuttons and it still looks like you pressed them, then you have to look at the code, else you might have connected them wrong or destroyed them while soldering..

Kees

Do you mean that I had to put the jumper wires the other way round?

like this?

Thanks I figured it out now.

can be, you have to measure that, i can't see that from here.. But if you disconnect all buttons (ie pull the wires from 6, 9 , 10 and 11) and it works lik you expect (ie display that nothing is pressed) then you have a problem with the buttons.
If all is working like expected, the you connect one button at a time (for instance 6) if it shows a message that one of the buttons is pressed, then it is very likely that you have to connect them 90 degrees rotated...

With those switches, if you only connect diagonal terminals you will avoid the short circuit.