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
  • LED Lights

LED Lights

Review and Practice

Self-check

  • In this activity, you:
    • built an LED circuit and used a script to turn the LED off and on, adjusting the timing to create different patterns.
    • calculated the period, frequency, and duty cycle.
  • Did you successfully build your LED circuit?
  • Can you adjust the rate at which the LED blinks and create different patterns?
  • Do you understand period, frequency, and duty cycle and can you calculate each?

Questions

  1. What are LEDs used for in products, and what are examples where they are used?
  2. How is period defined?
  3. How is frequency defined?
  4. How is duty cycle defined?
  5. What ways are you able to modify the blink of a light?

Exercises

  1. How would you modify a light on/off loop to change it from blinking every ½ second to blinking every ¼ second?
  2. How do you vary the script so that the time the light is on is longer than the time off?
  3. What sleep values would make the light appear to constantly be on but still be blinking?
  4. What part of the write_digital() statement signals that the light will turn off?
  5. How can the for…in range() loop be used with a light?
  6. If the period length is 1 s and the LED is on for .25 s during the period, how long is the LED off?
  7. If the period is .75 s, what is the frequency?
  8. What is the duty cycle for an LED that stays on for 500 ms and off for 500 ms?
  9. If the duty cycle is 30% and the LED stays on for 300 ms, how long is the period?

Projects

  1. Try adjusting the Try This – Blink Timing script to mimic a typical counting crosswalk signal. What considerations are there?
  2. Some warning lights blink faster as they ‘run out of time,’ for example the classic movie bomb countdown timer. Write a script to mimic this.

 


Printer-friendly version
On-Off Signals
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