I am thinking about starting a project, but I only know very little about writing code. In the code I will need the Arduino to move a servo motor probably about 20 degrees when a button is pushed. I will need the servo to keep moving 20 degrees every time the button is pushed and then reset to the beginning once it can't move 20 degrees anymore. If anyone knows how to write this code, please let me know.
If anyone knows how to write this code, please let me know.
I do. I'm not sure how that helps you, though.
There are plenty of examples of how to read a switch. There are plenty of examples of how to move a servo. It's not rocket science to figure out that you need to put the "move the servo" code in the "if switch becomes pressed" block.
@PaulS I'm sorry if I didn't make myself clear enough but as zoomkat understood I was hoping somebody would be kind enough to tell me how to write the code or help me write it. Thanks for trying to help though.