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

Measure Servo Signals

Measuring Servo Signal with an Oscilloscope

In earlier animations, you have seen how the write_analog(value) function calls make the micro:bit send repeating on/off (or high/low) signals to the servo.  The servo positions its horn at an angle in response to how long the ‘on’ part of the signal stays on.  These signals can be measured with the CYBERscope’s oscilloscope and compared to how this document said it’s supposed to work.

This kind of activity is the sort of thing students find themselves doing to make sure their motor will run properly before it’s connected.  Engineers also do this to verify that their prototypes are running properly, and technicians often take similar measurements when a device with motors isn’t running properly and needs to be diagnosed and fixed.

In this activity, you will:

  • Measure a servo signal’s period.
  • Calculate its frequency.
  • Verify 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.
  • Predict a pulse width at a certain angle and write a script to:
  • Set the servo to that angle
  • Test to verify that your predicted pulse width is correct

Parts

Same as previous activity + red alligator clip and jumper wire.

Circuit

We’ll be using the P2 red alligator clip lead to monitor signals the micro:bit sends to the servo.

  • Connect the red alligator clip lead from the 3-pin header at P2 to the same row as the servo’s orange signal wire.  As shown, it’s connected to (e, 14).

 

 


Printer-friendly version
Solutions
Prev
Script and Tests
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress