two Push-Buttons with seperate function to Servo

Hi guys,

i'm no professional coder yet so i still have some problems.
my idea is that i have two push-buttons connected to the servo:

first button - by holding the Push-Button the position of the servo should be 180, by releasing back to 0

second button - pressing it first time -> servo should go to 180, second press -> servo goes back to 0.

I dont know if i'm blind (i'm sorry if i am :D) but i dont find anything comparable in google.

For the first button, do a digitalread of the switch pin each time through loop() and do Servo.write(180) if it is pushed. Else if not pushed go to 0. It won't hurt anything to write to the servo each loop().

For the second, look into the state change detection example in the IDE (File, Examples, Digital). You can use the counter to decide whether the servo goes to 0 or 180. Even counts to 180, odd to 0 for example.

Thank you so much. You helped me a lot