Jump to navigation
Review and Practice
Self-check
- In this activity, you:
- Identified a servo’s major parts.
- Connected battery power and a servo to your breadboard.
- Wrote scripts to control which positions the servo held.
- Were you able to properly tune the servo?
- Were you able to use y = mx + b to calculate duty cycle and resulting angles?
Questions
- What are some ways that a hobby servo is likely different from a servo you would find used on larger equipment? Why?
- What is fed to the servo through the connected cable?
- Given the setup of the servo, what are the smallest and largest angles through which the servo can rotate?
- Why does this servo horn not make a complete rotation?
Exercises
- Approximately what analog value will result in the servo horn pointing to 90°?
- Approximately what analog value will result in the servo horn pointing to 180°?
- What command is used to set the servo horn in motion to a specific location?
- When controlling the servo, what is the purpose of pin16.set_analog_period(20)?
- What’s the actual high time from pin16.write_analog(77)?
Projects
- Create a script that will move the horn back and forth between 0° and 15°.
- Modify the terminal control program so it restricts the range from 45° to 135°.
- Modify the terminal control program so that it informs the user of an error when they try to enter a value that's out of the valid range.