Objective
We are going to control a servomotor through a potentiometer.
Tools
Arduino
Servo Motor
3 Jumper cables
Potentiometer
Arduino Software
Procedure
1. Connect Arduino to Mac using usb cable
2. Connect servo motor using jumper cable ( connect red to 5v input, black to ground, yellow to 9 digital in)
3. Connect potentionmeter (red to 5v input, black to ground, yellow to analog input 0)
4. Load knob example in arduino
5. Upload into arduino board
6. Turn potentiometer
7. Then switch the scale from 0-179, to 179-0. This will make the motor work in reverse
Results
Movement of the potentiometer resulted in the movement of the servo motor. When the scale is switched the servomotor turned in the opposite direction of the potentiometer