A couple of things that might help get you closer to your intended path;
It's great when people post their code - but it's really hard for people to read it easily unless it's posted with what's called "code tags" (especially for people using mobile devices). The good news is that's really easy to do:
Pop back into the IDE (where you wrote the program)
Do a ctrl+T to auto-format your sketch
Do a ctrl+A to select everything
Do a ctrl+shift+C to copy everything selected to the clipboard with the correct code tags in place
Paste your clipboard into your post here.
I've done that for you below.
When I looked at your code in my IDE I saw a way you can do some things a little easier; if you want to test if a switch is closed you don't need to copy it to a variable first ... you can just pop the digital read directly into the test statement ... which means you're dealing with less code (easier to spot problems) and you don't need to declare as many variables either - I've given you an example below (note: I stripped out your serial portions just so you can focus on what I mean) (I haven't compiled it because I don't have your libraries -- but it should be fine as a learning example).
There are other techniques to get around multiple sections of code that are for the most part identical too (called arrays), but that's a different topic for a different day -- still might be something you'd like to research at some point though.
With regards to the actual issue you're having, I really can't tell without knowing how you've got things connected. Because - as my learned friend alluded to - inputs can "float" to any state if there's nothing driving them either way - there's some simple techniques that we use to make sure that doesn't happen ...
One way is to use what's called a pull-down resister (10,000 ohms works well) between the pin and ground - and then connect the pin via a switch to your high voltage (+5 or +3.3 depending on what you're using). This is called "active high" (it's active when it's high).
But there's an even easier way ... all of the digital pins have a built in 20,000ohm pull-up resistor ... but it has to be turned on by using pinMode(buttonPin1, INPUT_PULLUP) - then all you need to do is connect the switch directly between the pin and ground ... no external resister needed. There's no real "downside" to this as such, but you do have to make a slight change to your program because the circuit is now what's called "active low" - so you'd test it using something like:
if(digitalRead(buttonPin1) == low)
{
my code ...
}
All available from the right click menu in the IDE, which may be easier..No need to do the ctrl+A as copying the whole sketch for the forum is the default
True, but then you don't have a variable to print for debugging when you need it. Sensibly named variables can also make code easier to read
You have two seconds of delay() in your loop(). That means that 99.9% of the time, your sketch is doing nothing. It also means you may need to hold a button down for more than two seconds before it will be noticed. I recommend you get rid of delays.
Are you 'buttons' actually switches? That would explain why your code is written to move the servo whenever the input changes.