IAT 267 Lecture Notes - Barcode, Servomotor, Book Scanning

50 views9 pages

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.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers