Setting up the Arduino
What hardware to buy:
- Arduino with twice as many ports as you think you'll need (uno or mega are good choices)
- Breadboard, power supply (or just plug it into your laptop), jumper cables
- It is often best to just buy a starter Arduino kit that has most of what you anticipate needing
- Any sensors, servos, actuators, etc. that you need.
Much of the hardware needed is available on Amazon.
Creating a servo circuit:
- Provide power to the Arduino by connecting it to a computer via USB.
- Launch Arduino Ino on your computer
- On the upper menu bar, select Tools<Port< select the port your Arduino is connected to. Remember the port name, you will need this later.
- Open servo.ino in Arduino and download the code to your Arduino by selecting the "upload" arrow.
- Connect the circuit as shown:
- Note that in the circuit the servo is connected to port 2, though we will refer to this as servo1. We generally want to leave the first port open as it also controls the LED.