Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Servo Position Control with Python and micro:bit

Servo Position Control with Python and micro:bit

Review and Practice

Self-check

  • In this activity, you:
    • Measured a servo signal’s period.
    • Calculated its frequency.
    • Verified that pulse width (how long the brief on-times last) is what contains the information the servo needs to respond to by correctly positioning its horn.
    • Predicted a pulse width at a certain angle and wrote a script to:
    • Set the servo to that angle
    • Test to verify that your predicted pulse width is correct
  • Were you able to measure a servo’s signal period and calculate the frequency?
  • Do you understand how the pulse width controls the servo horn position?
  • Were you able to write a script to control the servo angle and verify the measurements on the oscilloscope?

 

Questions

  1. Who might use an oscilloscope for servo measurements?
  2. What do you call the time that the signal stays high?
  3. Is the pulse width for a 45° angle narrower or wider than the pulse width of a 180° angle?
  4. What term is used to describe the space between two adjacent rising edges?
  5. What will the time difference be between the first and second signal period for a 90° angle?
     

Exercises

  1. What is the function of write_analog(value) in regards to the servo?
  2. What determines the angle of the servo horn?
  3. How do you determine the frequency of a signal?
  4. What is the duty cycle for a 15° angle?
     

Project

Predict the pulse width for 15°. Calculate the duty cycle for positioning the servo horn at 15° then write the script to verify your prediction that moves back and forth 0° and 15°.


Printer-friendly version
One More Angle
Prev
Solutions
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress