We have yet to experiment with inputs but if you would like to control your motor, a potentiometer is a great choice and the Arduino editor has a example program for it. We are going to learn about the potentiometer in CIRC08, but we can get our feet wet with this type of input by modifying CIRC04.
You'll only need to add one part to this circuit: the blue trim potentiometer. You can find it in your box:
Breadboard Trim Potentiometer - 10k
Wire it such that the two outermost pins go to the power and ground rail. The inner pin should go to the Metro's analog pin 0. Note that we are using an analog pin instead of a digital pin this time, they are located on the left side of the Metro instead of the right side.
Be careful - the Trim Potentiometer connects to the 3.3v input on the Metro, not the 5V rail.
The code to load potentiometer control onto your revised CIRC04 is provided by Arduino under
File > Servo > Knob. After loading the sketch, compile and upload it to your metro. Move the potentiometer left and right, you should see the servo move with it.
While it is easy to control a servo using the Metro's included library, sometimes it is fun to figure out how to program something yourself. Try it! Remember that we're controlling the pulse directly so you could use this method to control servos on any of the Metro's 20 available pins (you need to highly optimize this code before doing that).
Servos can be used to do all sorts of things. The Adafruit Learning System is a great resource to find a fun project with servos.
Here are a few of our favorites:
Our fully-assembled pan-tilt kit is the perfect way to give your project full range motion with two micro servos. The pan-tilt can rotate roughly 180° from side-to-side and can tilt up&downwards around 150°. It also comes fully assembled with two Micro Servos (SG-90 or SG-92 type) included and a 38mm x 36mm space to mount a camera or sensor or whatever you like.