2 Buttons 2 servos help

#include <Servo.h>

Servo myservo1; 
Servo myservo2;
                

 int pos = 0;    
 int button1 = 2;    
    int button2 = 3; 
 
 void setup (void)
 {
   myservo1.attach(9);
      myservo2.attach(10);

   
    pinMode(pos, OUTPUT);
 pinMode(button1, INPUT);
 pinMode(button2, INPUT);
  digitalWrite (button1, LOW);
    digitalWrite (button2, LOW);
 }
 
 void loop (void)
 {
   
   if (digitalRead(button1) == LOW)

   
  {                                 
    myservo1.write(0); 
    
  }
  
  if (digitalRead(button1) == HIGH)

   
  {                                 
    myservo1.write(180); 
    
  }
if (digitalRead(button2)== LOW)

   
  {                                 
    myservo2.write(0); 
    
  }
  
  if (digitalRead(button2) == HIGH)

   
  {                                 
    myservo2.write(180); 
    
  }
 }

is my new code, im not sure why it does not work, seems good to me, but im pretty new though, no errors, just the second button does not move the second servo, the first button moves the first servo just fine though

You are turning off the internal pullup resistors, then expecting them, or external pullup resistors, to be in place. So, does this mean that you have wired in external pullup resistors? If so, why?

im sorry, i dont know what you mean, i just have 2 10k resistors connected to the buttons, nothing else

im sorry, i dont know what you mean

You need either internal or external, pullup or pulldown, resistors. The Arduino has internal pullup resistors. When using them, you connect one leg to the digital pin and one leg to ground. Then, pressed means the pin is LOW. Much easier than dealing with external resistors.

heres my code:

#include <Servo.h>

Servo myservo1; 
Servo myservo2;
                

 int pos = 0;    
 int button1 = 2;    
    int button2 = 3; 
 
 void setup (void)
 {
   myservo1.attach(9);
      myservo2.attach(10);

   
    pinMode(pos, OUTPUT);
 pinMode(button1, INPUT);
 pinMode(button2, INPUT);
  digitalWrite (button1, LOW);
    digitalWrite (button2, LOW);
 }
 
 void loop (void)
 {
   
   if (digitalRead(button1) == LOW)

   
  {                                 
    myservo1.write(0); 
    
  }
  
  if (digitalRead(button1) == HIGH)

   
  {                                 
    myservo1.write(180); 
    
  }
if (digitalRead(button2)== LOW)

   
  {                                 
    myservo2.write(0); 
    
  }
  
  if (digitalRead(button2) == HIGH)

   
  {                                 
    myservo2.write(180); 
    
  }
 }

it only makes 1 button move 1 servo, the other button does not make the other servo move, please help

Isn't cross-posting utterly, utterly pointless?

i dont know what you are talking about, i dont know the terminology, im not sure why you would expect me to when you can tell im a noob…

Being a noob is no excuse for not being able to:

Properly indent your code. Or use Tools + Auto Format if you are really that lazy.
Put Serial.begin() and Serial.print() statements in the code, so you KNOW what is going on.
Describe how the f**king switches are wired, how the servos are wired, etc.

   if (digitalRead(button1) == LOW)
  if (digitalRead(button1) == HIGH)

If the pin isn't LOW, there is not a snowball's chance in hell that is won't be HIGH. if happens to have a brother, else. Use it!

it only makes 1 button move 1 servo, the other button does not make the other servo move, please help

Which f**king switch makes which servo move? It REALLY isn't necessary to make us ask such OBVIOUS questions.

Two buttons controlling a single servo.

//zoomkat servo button test 12-29-2011
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
int button2 = 5; //button pin, connect to ground to move servo
int press2 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
  digitalWrite(5, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(170);
  }    
  
  press2 = digitalRead(button2);
  if (press2 == LOW)
  {
    servo1.write(10);
  }
}

There are many people on these forums asking questions of all kinds every single day. Folks like AWOL, PaulS and zoomkat are always around (with a few others who are in almost every thread on this site) and willing to try to help.

If you look around a lot on this site you will see if there is a well described issue with all the information required to diagnose the problem all of the senior members of the site will do anything they can to assist.
On the other hand, when someone says “it’s broken…” with no supporting details on what situation they have (code and wiring) and how they intended things to work, the folks that are normally extremely helpful… tend to get a bit short.

If you want the best possible assistance from this site… Read and follow this page put together by Nick Gammon.

After reading the post by Nick, watch this video about pull up/down resistors. Electronics 201: Pull-Up and Pull-Down Resistors - YouTube

The Arduino has some internal ones that you simply have to enable in your code. If you don’t have these enabled then you have to install them externally or your inputs will “float” and you will never achieve reliable,repeatable results.

Hope this helps you in the future to get better assistance from the site.

In the end it comes down to search, search, read, read, read, watch videos, look at wikipedia, search some more, then if you cant find you answer… ask. But when you ask put every bit of information someone might need in order to best give YOU assistance solving YOUR issue.

BananaFofana:
i dont know what you are talking about, i dont know the terminology, im not sure why you would expect me to when you can tell im a noob....

Cross-posting is asking the same question more than once, like here.
It wastes time.
Don't do it.