IAT 267 Lecture Notes - Barcode, Servomotor, Book Scanning
Document Summary
Many objects that you want to turn or rotate can be manipulated with a servo. An easy correlation between a potentiometer and a servo can be established: turn the potentiometer and the servo turns. Need to provide the servomotor with power from the 5v arduino board. Ground connection to the gnd on the arduino board/breadboard. Controlling a servo is just a matter of determining how long in microseconds you need to send each command to the servo. Writing a pulse to the motor that is the desired length. A value between 0 and 180 degrees (followed by a non-digit character) is sent using the serial connection to a computer to the servo. The library is included with the arduino ide. It lets arduino control one or more servomotors. Starts reading the servo instance on the pin passed into the method servo. attach(pin); servo. attach(pin, min, max); // optionally set the min and max pulse widths read() method.