Arduino Input and Servo

In this assignment you get to combine a servo, two LEDs and a button into one circuit and program.

You can build this in Tinkercad first OR go straight to Arduino programming with a real circuit. You will ONLY turn in a video of your completed, real life circuit.

Here’s the outline of what your program will do:
1. program starts.
2. the green light is on and the red light is off.
3. press the button.
4. the green light goes out.
5. the red light turns on.
6. the servo moves for five seconds.  You choose what kind of servo movement occurs.
7. the servo stops moving.
8. the red light goes out.
9. the green light turns on.

Here are some resources to get you going:

wiring a button (input) and a three LEDs

wiring and programming standard and continuous servos

And this diagram shows the structure of a program with an input.  The key thing to remember is that you only need ONE of each:
>declaration of variables (int red = 13;)
>void setup
>void loop

Arduino input button code