Have you got resistors in place keeping the input pins in a known state at all times even when the buttons are not pressed ?
How are the buttons wired ? I am guessing that pressing a button takes its pin HIGH. Change that to take the pin LOW when the button is pressed and change the pinMode()s to INPUT_PULLUP instead of INPUT to turn on the built in pullup resistors so that the pins are always in a known state
If you use INPUT_PULLUP you do not need external pulldown resistors. Also make sure that you have used 2 switch contacts that are actually switched by pressing the button. Diagonally opposite pins are a good choice
I can't make much sense of your wiring. Simply use INPUT_PULLUP and connect the switches so that the pin goes to GND when the button is pressed. You seem to have far too many wires and don't need the resistors
Then make it simpler and don't use the buttons for now
Use INPUT_PULLUP in pinMode()
Test for inputs being LOW in the sketch
Connect a jumper wire from GND to one of your input pins. If the servo moves then disconnect the wire from that input pin and connect it to the other one
It would be easier to understand the code if you set position before using it instead of after.
if (etatbouton==LOW) {
position = 0;
monservo.write (position);
delay(150);
}
if (etatbouton2==LOW) {
position = 180;
monservo.write (position);
delay(150);
}
The following diagram may help OP to connect his buttons using internal pull-up resistors. The diagram also shows how to power the Servo from separate 5V supply.
When you set the Serial.begin(115200), be sure to also set it in the Serial Monitor, bottom right corner.
As for your wiring, it's best to wire to opposite corners of the button - "diagonal", as this ensures you haven't connected two pins that are internally connected, which will give you a continuous connection, and won't work as a button. You may have chosen the right pins now, but you wouldn't be the first to get it wrong by connecting to the same side, either. Are both green wires which go to the buttons connected to +5? If you can't draw a schematic, and therefore insist on photographs, at least arrange the wiring so we can see, without a doubt, where each wire is going. Many posters on this forum simply walk away from threads where the poster produces pictures like this.
BTW - Could you explain why 115200 is a "little hard for you"? This is puzzling.
C